diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/mem_board_central.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/mem_board_central.h index ba0729f7d..ad45a57a6 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/mem_board_central.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/mem_board_central.h @@ -26,15 +26,7 @@ static void MemBoard_init(void){ // mem_UART_display(txBuf); } -/*! - * main function - */ -static void mem_central_event() { - if (flag_mask(EVT_NEU_SPI)) { - flag_disable(EVT_MEM_LED); - SetMemOutputPIN(Board_GLED, 1); - } -} +static void mem_central_event(); static EventTableEntry EVENT_TABLE[] = { // {EVT_ALL, &mem_central_event}, @@ -53,9 +45,27 @@ static void mem_event_handle() { entry->event_callback(); } } +} - // remove system one-shot flag - flag_disable(0xF0000000); +typedef enum{ + LED_OFF, + LED_ON +} LEDStatus; + +static LEDStatus GLEDStatus = LED_OFF; + +static void mem_central_event() { + if (flag_mask(EVT_NEU_SPI)) { + flag_disable(EVT_MEM_LED); + GLEDStatus = LED_ON; + SetMemOutputPIN(Board_GLED, 1); + } + + if(flag_mask(EVT_NEU_SPI_OFF)){ + flag_disable(EVT_MEM_LED_OFF); + GLEDStatus = LED_OFF; + SetMemOutputPIN(Board_GLED, 0); + } } diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/mem_event.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/mem_event.h index c6e81b9a9..50533b6c0 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/mem_event.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/mem_event.h @@ -42,6 +42,7 @@ #define EVT_ALL 0xFFFF #define EVT_MEM_LED 0x0001 /**< set led event */ #define EVT_MEM_UART 0x0002 /**< UART transaction event */ +#define EVT_MEM_LED_OFF 0x0004 uint16_t EventMask = 0; diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/simple_central.c b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/simple_central.c index 3ee4d7936..a50353b6c 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/simple_central.c +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_central/cc26xx/app/simple_central.c @@ -631,7 +631,7 @@ static void SimpleBLECentral_taskFxn(UArg a0, UArg a1) } if(EventMask > 0){ - + mem_event_handle(); } } @@ -964,7 +964,12 @@ static void SimpleBLECentral_handleKeys(uint8_t shift, uint8_t keys) case BLE_STATE_IDLE: if(keys & KEY_UART_EN) { - flag_notify(EVT_MEM_LED); + if(GLEDStatus == LED_OFF){ + flag_notify(EVT_MEM_LED); + } + else{ + flag_notify(EVT_MEM_LED_OFF); + } } if (keys & KEY_RIGHT) diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h index c74e3d80b..5c300f448 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h @@ -5,12 +5,12 @@ #define VERSION_DATE_YEAR 20 #define VERSION_DATE_MONTH 5 #define VERSION_DATE_DAY 15 -#define VERSION_DATE_HOUR 11 -#define VERSION_DATE_MINUTE 48 +#define VERSION_DATE_HOUR 12 +#define VERSION_DATE_MINUTE 10 // this is NOT the version hash !! // it's the last version hash -#define VERSION_HASH 47054d91c873419db2e6d334e90d633ac9fd499a +#define VERSION_HASH 08a71366f7dd7be3bbc7a024cb9911ac2efed599 #define VERSION_GIT_BRANCH MemBoard_simple_central #endif