Shouldn't Pin_Write(1u) keep pin high forever? | Cypress Semiconductor
Shouldn't Pin_Write(1u) keep pin high forever?
I am working through Alan Hawes' videos using the PSoC 4 BLE and am extending his code from the following video:
To start experimenting with the API I am going to use the LED connected to a pin to indicate whether something happened or not. To start, I use the following code to turn the LED on as CYBLE_ERROR_OK must be returned (the slider function works fine):
CyGlobalIntEnable; /* Enable global interrupts. */
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
thingy = CyBle_Start(Stack_Handler);
if(thingy == CYBLE_ERROR_OK) LED_Write(1u);
When I turn on or reset the board the LED turns on and then turns off. I think that it should remain of forever, or until I turn the board off. I have
- disabled "HW connection" under "Digital output",
- set the "Drive mode" to "Strong drive"
- left all other pin settings at their default
- pin name is now "LED"
- set pin 43 (P2) as the LED connection
I have tested the following added immediately after the "if" line shown above:
This causes the LED to blink, so I know that my code is working, just not as I expect it to. I expect the LED to remain on after the for(;;) loop is entered. That blinking code also works when made part of the "if" statement showing that "thingy" did indeed equal "CYBLE_ERROR_OK".
What am I not understanding about pins?