Tool/software: Code Composer Studio
Hello,
I'm trying to wake up the CC2640r2 from standby via a button push like this:
static void SimplePeripheral_handleKeys(uint8_t keys) { bStatus_t status = SUCCESS; //uint8_t buttonClosed = 1; //uint8_t buttonOpen =0; if (keys & KEY_LEFT) { // Check if the key is still pressed. Workaround for possible bouncing. if (PIN_getInputValue(Board_PIN_BUTTON0) == 1); { status = PIN_getInputValue(Board_PIN_BUTTON0); status = GapAdv_enable(advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0); SIMPLEPERIPHERAL_ASSERT(status == SUCCESS); //SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR4, sizeof(uint8_t), &buttonOpen); //tbm_buttonLeft(); } if (PIN_getInputValue(Board_PIN_BUTTON0) == 0) { //SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR4, sizeof(uint8_t), &buttonClosed); //tbm_buttonLeft(); }else { tbm_buttonLeft(); } }
Sorry for the messy cpde, I'm still dittling around with it. This lets me begin advertising when the button is pushed. In this application the button stays pushed. With the button pushed for 10+ seconds the device stops advertising and can no longer be woke up with a button push. I need to rebuild the app and redownload it to have the device begin to advertise after a button push. Is there a way to release this pin at the end of this function so that it will not disrupt the operation of the device?
Thanks,
Patrick