Tool/software: TI-RTOS
while(1) { Semaphore_pend(semaphore_txTask, BIOS_WAIT_FOREVER); if (!txFreqHoppingEnabled & !rxFreqHoppingEnabled) {
processRFState(); //receives the packet RX_ON is preset and RX_OFF set once transmitted if(transmit_flag == 1){ UART_write(uart, "n10\n", 4); rfState = TX_TURN_ON; //transmitting flag is set TX_ON and TX_OFF set once done transmitting processRFState(); transmit_flag = 0; } PIN_Status status = PIN_registerIntCb(buttonPinHandle, &buttonCallbackFxn); UART_write(uart, "no\n", 3); } } } void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) { //CPUdelay(8000*50); // UART_write(uart, "inside1112\n", 11); if (!PIN_getInputValue(pinId)) { UART_write(uart, "n9\n", 3); transmit_flag = 1; Semaphore_post(semaphore_txTask); } }
I have this code which receives prints on UART and then transmits and prints the data on UART. This loop is working fine.
I want to implement button press in this where in my code also tests a button connected to mcu , the button functionality also is working and something prints too from the call back function.
Now I want to press the button to turn the mcu on (which works) and receive the data(works) but I have to press the button again and then transmit the data(doesn't work).
Right now the way it works is after button press the mcu receives data, waits for button to be pressed again, after button press goes to ISR prints n9 goes to main loop prints n10 and then it stops.
I am very new to RTOS hence probably missing something in my code. Any input would be very helpful.
Thank you.