Inside the ISR of an HWI, i am trying to make the output pin high and low but the pin is not going high. it is always staying low. it works only when i put the breakpoint on the instruction setting the pin low. what can be the reason?please help.
PIN_Config kbi_pin_table[] = { IOID_9 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH |PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */ PIN_TERMINATE /* Terminate list */ };
void spi_createTask(void) { // Display_init(); GPIO_init(); SPI_init(); Task_Params taskParams; // Configure task Task_Params_init(&taskParams); taskParams.stack = appTaskStack; taskParams.stackSize = SPI_TASK_STACK_SIZE; taskParams.priority = SPI_TASK_PRIORITY; Task_construct(&SPI_task, SPI_taskFunction, &taskParams, NULL); }
void SPI_taskFunction(UArg arg0, UArg arg1) { /* Local variables. Variables here go onto task stack!! */ /* Run one-time code when task starts */ SPI_Handle masterSpi; SPI_Params spiParams; uint32_t i; hPin_wakeup = PIN_open(&pinState_wakeup, wakeup_pin); // Register ISR PIN_registerIntCb(hPin_wakeup, buttonHwiFxn); standbysem = Semaphore_create(0, NULL, Error_IGNORE); if (standbysem == NULL) { while (1); } while(1) { //KBI high hPin_kbi = PIN_open(&pinState_kbi, kbi_pin_table); PIN_setOutputValue(hPin_kbi, IOID_9, 1); /* Open SPI as master (default) */ Semaphore_pend(standbysem, BIOS_WAIT_FOREVER); if(wakeup_flg); { while(PIN_getInputValue(IOID_18) == 1); wakeup_flg=0; SPI_Params_init(&spiParams); spiParams.frameFormat = SPI_POL0_PHA0; spiParams.bitRate = 1000000 ; spiParams.dataSize = 16; spiParams.mode = SPI_MASTER; masterSpi = SPI_open(Board_SPI_MASTER, &spiParams); if (masterSpi == NULL) { // Display_printf(display, 0, 0, "Error initializing master SPI\n"); while(1); } else { // Display_printf(display, 0, 0, "Master SPI initialized\n"); } for (i=0; i < SPI_MSG_LENGTH; i++) memmove((void *)masterTxBuffer+i, (const void *)masterTxBuffer1+i, 1); vfnSpiPerformXfers(masterSpi); SPI_close(masterSpi); } } }