Recognizes and processes commands

This commit is contained in:
NaifBanana
2026-10-21 15:32:35 -05:00
parent 68b5399f53
commit 7b459214c8
+8 -3
View File
@@ -9,7 +9,7 @@
char NULLCHAR = 0x0;
QueueHandle_t MESSAGES = NULL;
bool LIGHT = false;
void vReadSerial(void* params) {
// Setup
@@ -64,8 +64,13 @@ void vProcessMessages(void* params) {
char* command = pvPortMalloc(BUFFER_SIZE * sizeof(char));
while(MESSAGES != NULL) {
if (xQueueReceive(MESSAGES, command, 50)) {
printf("Recieved message: ");
printf("%s\n", command);
if (strcmp("blink", command)) {
printf("Recieved message: ");
printf("%s\n", command);
} else {
LIGHT = !LIGHT;
gpio_put(PICO_DEFAULT_LED_PIN, LIGHT);
}
}
}