.. _sec-Remove-Display-Module:

Remove Dispaly Module 
=====================

This guide aims to remove the Display Module and related code to simplify |DEVICE| basic_ble example 
to reduce memory footprint.

1. In Sysconfig Display section in TI Drivers and click on "Remove All" (top right).
2. Exclude MenuModule from build under common and app_menu.c from app folder.
3. Comment out Menu_start() App_StackInitDoneHandler() from app_main.c 
4. Comment out MenuModule_printf() and #include "ti/ble/app_util/menu/menu_module.h" in:
   
    * app_main.c
    * app_simple_gatt.c 
    * app_connection.c
    * app_pairing.c 
    * app_peripherial.c 
    * app_data.c


.. _sec-Remove-Display-Module-from-Sysconfig:

1. Remove the Display Module from Sysconfig
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Removing the Diplay Module from SysConfig can be done by using the **Remove All**  button from 
Display section in TI Drivers.

.. _Syscfg_Remove_Display_Module1:
.. figure:: resources/Syscfg_Remove_Display_Module.png
    :align: center 


.. _sec-Remove-Display-Module-related-folders-and-files:

2. Exclude the Display Module related folders and files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To exclude Menu Module related folder from the build, expand the common folder. Then, right 
click to exclude from build. Do the same with app_menu.c file in Profiles folder. 

.. _Exclude_Display_Module_related_folders_and_files:
.. figure:: resources/Exclude_Display_Module_related_folders_and_files.png
    :align: center


.. _sec-Exclude-Menu-start-realted-functions:

3. Exclude Menu start functions 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To exclude Menu start realted functions, go to app_main.c and comment out Menu_start() and MenuModule_printf() in App_StackInitDoneHandler()

.. _Exclude-Menu-start-realted-functions:
.. figure:: resources/Exclude_Menu_start_realted_functions.png
    :align: center


.. _sec-Exclude-Display-related-functions-and-inclusions :

4. Exclude the Display related functions and inclusions 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To exclude display related functions and inclusions, comment out MenuModule_printf() and 
#include "ti/ble/app_util/menu/menu_module.h" in :

* app_main.c
* app_simple_gatt.c 
* app_connection.c
* app_pairing.c 
* app_peripherial.c 
* app_data.c

The project is now clear from everything related to the Dipaly Module. The Following capture shows the
expectation in terms of memory allocation.

.. _Memory_allocations_expected:
.. figure:: resources/Memory_allocations_expected.png
    :align: center