AGH UST MBED part 2
Dependencies: LCD_DISCO_F429ZI mbed BSP_DISCO_F429ZI
Diff: main.cpp
- Revision:
- 3:6fc7976cc5bf
- Parent:
- 2:8788d711db7e
- Child:
- 4:e48aee3e8d09
--- a/main.cpp Wed May 20 15:42:07 2020 +0000 +++ b/main.cpp Wed May 20 16:37:25 2020 +0000 @@ -41,25 +41,25 @@ int main() { + Tokenizer MyTokenizer; char cTablica[BUFFER_SIZE]; - extern struct Token asToken[]; - extern unsigned char ucTokenCnt; + while(1){ if(!gets(cTablica, BUFFER_SIZE)){ - DecodeMsg(cTablica); - if ((asToken[0].eType == KEYWORD) & (ucTokenCnt != 0)){ - switch (asToken[0].uValue.eKeyword){ - case (CLB): - led_green = !led_green; - break; - case (GT): - led_red = !led_red; - break; - default: - break; + MyTokenizer.DecodeMsg(cTablica); + if ((MyTokenizer.eGetTokenType(0) == KEYWORD) & (MyTokenizer.GetTokenCnt() != 0)){ + switch (MyTokenizer.eGetKeyword(0)){ + case (CLB): + led_green = !led_green; + break; + case (GT): + led_red = !led_red; + break; + default: + break; + } } - } } } }