From f5f4fa55ebf45a1addb0b15121ef9dd4244ad851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Mon, 25 Jan 2016 00:46:09 +0100 Subject: [PATCH] combine on/off with refresh --- lib/vfd.c | 18 +++--------------- lib/vfd.h | 14 ++------------ main.c | 20 +++++--------------- 3 files changed, 10 insertions(+), 42 deletions(-) diff --git a/lib/vfd.c b/lib/vfd.c index d44275d..e6ddf95 100644 --- a/lib/vfd.c +++ b/lib/vfd.c @@ -399,8 +399,7 @@ void vfd_matrix(uint8_t nb, char c) } } -/* clear VFD display - * the data has to be transmitted separately */ +/* clear VFD display */ void vfd_clear(void) { for (uint8_t i=0; i to ASCII character * use the MSB of to enable the dot */ void vfd_digit(uint8_t nb, char c); /* set dot matrix to ASCII character * non ASCII characters are used for pictures */ void vfd_matrix(uint8_t nb, char c); -/* clear VFD display - * the data has to be transmitted separately */ +/* clear VFD display */ void vfd_clear(void); -/* test VFD display (light up all anodes) - * the data has to be transmitted separately */ +/* test VFD display (light up all anodes) */ void vfd_test(void); /* transmit every digit and matrix */ void vfd_on(void); /* switch VFD display off */ void vfd_off(void); -/* output data on the parts */ -void vfd_refresh_on(void); -/* stop outputing data on the parts*/ -void vfd_refresh_off(void); /* setup VFD */ void vfd_setup(void); diff --git a/main.c b/main.c index 7f6c791..c944810 100644 --- a/main.c +++ b/main.c @@ -79,19 +79,17 @@ int main(void) vfd_on(); // switch on VFD - vfd_refresh_on(); - vfd_test(); - for (uint32_t i = 0; i < 0x800000; i++) { + vfd_test(); // show all anodes + for (uint32_t i = 0; i < 0x800000; i++) { // show for a bit of time __asm__("nop"); } - vfd_clear(); + vfd_clear(); // clear all data bool vfd_flag = false; - bool refresh = true; - for (uint8_t i=0; i