/* * monitor.c * * Created: Mar 2021 * Author: Arjan te Marvelde * * Command shell on stdin/stdout. * Collects characters and parses commandstring. */ #include #include #include "pico/stdlib.h" #include "lcd.h" #include "si5351.h" #include "monitor.h" /* Monitor definitions */ #define ENDSTDIN 255 #define CR 13 #define LF 10 #define CMD_LEN 32 char mon_cmd[CMD_LEN+1]; uint8_t si5351_reg[200]; /* Commandstring parser */ char delim[] = " "; #define NCMD 4 char shell[NCMD][3] = {"si", "lt", "fb", "xx"}; void mon_parse(char* s) { char *p; int base, nreg, i; p = s; //strtok(s, delim); // Get command part of string for (i=0; i "); // prompt break; default: if ((c<32)||(c>=128)) break; // Alfanumeric? putchar((char)c); // echo character mon_cmd[i] = (char)c; // store in command string if (i