- introduced enterCritical, exitCritial
git-svn-id: http://moon:8086/svn/projects/HendiControl@36 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
@@ -123,10 +123,7 @@ int main(void)
|
||||
Msg_t msg;
|
||||
if (!fifo_isEmpty(&messageFifo))
|
||||
{
|
||||
cli();
|
||||
fifo_pop(&messageFifo, &msg);
|
||||
sei();
|
||||
|
||||
switch(msg.code)
|
||||
{
|
||||
case Uart:
|
||||
@@ -135,6 +132,9 @@ int main(void)
|
||||
cmdStr[cmdStrSize] = 0;
|
||||
char c = msg.data;
|
||||
|
||||
putchar(c);
|
||||
break;
|
||||
|
||||
// Command finished with CR/LF
|
||||
if (c == 0x0A || c == 0x0D)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ int main(void)
|
||||
if (state == StateNormal || state == StateRemote)
|
||||
{
|
||||
// Power Control
|
||||
if (toupper(cmdStr[0]) == 'P')
|
||||
if (toupper(cmdStr[0]) == 'Z')
|
||||
{
|
||||
uint16_t arg = (uint16_t)strtol(cmdStr+1, (char **)NULL, 10);
|
||||
setPower(arg);
|
||||
@@ -170,7 +170,7 @@ int main(void)
|
||||
{
|
||||
if (cmdStrSize < (sizeof(cmdStr)-1))
|
||||
{
|
||||
printf("%c", c);
|
||||
putchar(c);
|
||||
cmdStr[cmdStrSize++] = c;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user