Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 21927

How to correct flash the LED in MSP430F6438 with SPPLEDemo_Lite ?

$
0
0

Hi , I am developing in MSP430F5335 + CC2564 with IAR SPPLEDemo_Lite project.

I use the following code to change the LED state.

void Toggle6438LED(void)
{
    if(P9OUT & BIT4)
        P9OUT &= ~BIT4; 
    else
        P9OUT |= BIT4; 
}

I want to control LED via BLE , for example

1. When I send start command(ex:0x01) to device , it will start flash the LED and change the state to 1 via the following code:

state = 1;

while(state == 1)
{
  Toggle6438LED();
  BTPS_Delay(200);
  Toggle6438LED();
  BTPS_Delay(1200);
}

2. When I send stop command(ex:0x02) to device , it will stop flash the LED via change the state to 0. 

state = 0;

But It doesn't receive the stop command(ex:0x02) after the while loop is running.

It seems the code is blocked by while loop. 

How to correct flash the LED and does not affect the other operation in MSP430F6438 with SPPLEDemo_Lite ?

Thanks in advance.

Viewing all articles
Browse latest Browse all 21927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>