Hello friends,
I have the following problem, and I hope you can me help solve. I am trying to read the status of a pin in the MSP432P401R, after he made a data transmission (TX), the CS pin goes High, and when all data finish he change the state pin to Low. In the debug mode, a follow the state of pin, but I dont see any change. I wrote the following code the goal it has when the function are called one interruption is required.
int main(void){ DRDY_Work(); while(1){ while(!finish_flag); MAP_GPIO_disableInterrupt( GPIO_PORT_P4, GPIO_PIN4); finish_flag=0; MAP_GPIO_clearInterruptFlag( GPIO_PORT_P4, GPIO_PIN4); MAP_GPIO_enableInterrupt( GPIO_PORT_P4, GPIO_PIN4); } } } void DRDY_Work(void){ MAP_GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P4, GPIO_PIN4); GPIO_interruptEdgeSelect(GPIO_PORT_P4,GPIO_PIN4, GPIO_HIGH_TO_LOW_TRANSITION); MAP_GPIO_clearInterruptFlag(GPIO_PORT_P4, GPIO_PIN4); MAP_GPIO_enableInterrupt(GPIO_PORT_P4, GPIO_PIN4); MAP_Interrupt_enableInterrupt(INT_PORT4); } void PORT4_IRQHandler(void){ uint32_t status; status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P4); MAP_GPIO_clearInterruptFlag(GPIO_PORT_P4, status); /* Toggling the output on the LED */ if(status & GPIO_PIN4){ finish_flag = 1; } }
Thanks in advance