- introduced enterCritical, exitCritial

git-svn-id: http://moon:8086/svn/projects/HendiControl@36 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-03-02 14:28:06 +00:00
parent a94413670a
commit c092db8909
5 changed files with 89 additions and 41 deletions
+5 -5
View File
@@ -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;
}
}