X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=int%2Fnucleo-f767-blinky%2Fsrc%2Finterface.c;h=96077b0e150e109ea2cabd6f5ef0b7f3fe75b473;hb=0efbd98973520d55ec4e80e443911f43b3c28a0d;hp=2f7fb5754bcbc557f4d218787e0e5f1dd6f1624b;hpb=ddfd196fa4999b117701121a2f4cb1fe378f902d;p=mTask.git diff --git a/int/nucleo-f767-blinky/src/interface.c b/int/nucleo-f767-blinky/src/interface.c index 2f7fb57..96077b0 100644 --- a/int/nucleo-f767-blinky/src/interface.c +++ b/int/nucleo-f767-blinky/src/interface.c @@ -32,6 +32,7 @@ //Globals #ifdef STM32F767xx volatile char uartf = 0; +char buf[128]; #else struct timeval tv1; int sock_fd = -1; @@ -78,7 +79,7 @@ long millis() { bool input_available(){ #ifdef STM32F767xx - return false; + return true; #else struct timeval tv; fd_set fds; @@ -112,6 +113,55 @@ void write_byte(uint8_t b) #endif } +void write_dpin(uint8_t i, bool b) +{ +#ifdef STM32F767xx +#else + debug("dwrite %d: %d\n", i, b); +#endif +} + +bool read_dpin(uint8_t i) +{ +#ifdef STM32F767xx + return false; +#else + debug("dread %d\n", i); + return false; +#endif +} + +void write_apin(uint8_t i, uint8_t a) +{ +#ifdef STM32F767xx + if(i == 1){ + SET_LED_RED; + RESET_LED_BLUE; + RESET_LED_GREEN; + } else if(i == 2){ + RESET_LED_RED; + SET_LED_BLUE; + RESET_LED_GREEN; + } else if(i == 3){ + RESET_LED_RED; + RESET_LED_BLUE; + SET_LED_GREEN; + } +#else + debug("awrite %d: %d\n", i, a); +#endif +} + +uint8_t read_apin(uint8_t i) +{ +#ifdef STM32F767xx + return 0; +#else + debug("aread %d\n", i); + return 0; +#endif +} + void delay(long ms) { #ifdef STM32F767xx