From aab6172a36e40b601f4f58750e6ba2fff192ba72 Mon Sep 17 00:00:00 2001 From: MegiDervishi Date: Tue, 5 Jan 2021 00:14:52 +0100 Subject: [PATCH] small changes --- lcd_hept/arduinolib.c | 44 ++----------------------------------- lcd_hept/arduinolib_types.h | 14 +----------- lcd_hept/prog.ept | 6 ++--- 3 files changed, 5 insertions(+), 59 deletions(-) diff --git a/lcd_hept/arduinolib.c b/lcd_hept/arduinolib.c index 8e434d6..4757f5d 100644 --- a/lcd_hept/arduinolib.c +++ b/lcd_hept/arduinolib.c @@ -120,14 +120,6 @@ void Arduinolib__lcd_char_step(uint8_t char_data, Arduinolib__lcd_char_out *out) Arduinolib__lcd_write_step(char_data << 4, o2); // lower 4 bits } - -/*const char* Arduinolib__int_to_string_step(uint8_t number, Arduinolib__int_to_string_out *out){ - char *lstring = "mrgi"; - //itoa(number, lstring, 10); - return lstring; -}*/ - - /* give a string to display to the LCD*/ void Arduinolib__lcd_string_step(uint8_t lstring[], int line, Arduinolib__lcd_string_out *out){ Arduinolib__lcd_cmd_out *o1; @@ -146,6 +138,8 @@ void Arduinolib__lcd_string_step(uint8_t lstring[], int line, Arduinolib__lcd_st _delay_us(80); //more than 39us } } + +/* gice a number to display to the LCD */ void Arduinolib__lcd_int_step(uint8_t numb, int line, Arduinolib__lcd_int_out *out){ char lstring[80]; itoa(numb, lstring, 10); @@ -153,37 +147,3 @@ void Arduinolib__lcd_int_step(uint8_t numb, int line, Arduinolib__lcd_int_out *o Arduinolib__lcd_string_step(lstring, line, o); } -/*void Arduinolib__lcd_string_step(uint8_t lstring[], Arduinolib__lcd_string_out *out){ - volatile int i = 0; - for (i = 0; lstring[i] != 0 ; i++) { - Arduinolib__lcd_char_out *o3; - Arduinolib__lcd_char_step(lstring[i], o3); - _delay_us(80); //more than 39us - } -}*/ - -/*void Arduinolib__print_string_step(uint8_t lstring[], int line, Arduinolib__print_string_out *out){ - Arduinolib__lcd_cmd_out *o1; - Arduinolib__lcd_cmd_out *o2; - if (line == 1) { - Arduinolib__lcd_cmd_step(LCD_CURSOR_SET | LCD_START_LINE2, o1); - _delay_us(80); //more than - } else { - Arduinolib__lcd_cmd_step(LCD_CURSOR_SET | LCD_START_LINE1, o2); - _delay_us(80); - } - volatile int i = 0; - for (i = 0; lstring[i] != 0 ; i++) { - Arduinolib__lcd_char_out *o3; - Arduinolib__lcd_char_step(lstring[i], o3); - _delay_us(80); //more than 39us - } -} - -void Arduinolib__print_int_step(uint8_t number, int line, Arduinolib__print_int_out *out){ - char lstring[80]; //buffer - itoa(number, lstring, 10); //convert int to str - - Arduinolib__lcd_string_out *o; - Arduinolib__lcd_string_step(lstring, o); -}*/ diff --git a/lcd_hept/arduinolib_types.h b/lcd_hept/arduinolib_types.h index 3fd8174..7180505 100644 --- a/lcd_hept/arduinolib_types.h +++ b/lcd_hept/arduinolib_types.h @@ -23,16 +23,9 @@ typedef struct Arduinolib__lcd_cmd { typedef struct Arduinolib__lcd_char { } Arduinolib__lcd_char_out; -typedef struct Arduinolib__int_to_string { - const char* snumb; -} Arduinolib__int_to_string_out; - typedef struct Arduinolib__lcd_string { } Arduinolib__lcd_string_out; -typedef struct Arduinolib__print_string { -} Arduinolib__print_string_out; - typedef struct Arduinolib__lcd_int { } Arduinolib__lcd_int_out; @@ -44,13 +37,8 @@ void Arduinolib__lcd_cmd_step(uint8_t cmd, Arduinolib__lcd_cmd_out *o); void Arduinolib__lcd_char_step(uint8_t char_data, Arduinolib__lcd_char_out *o); -/*const char* Arduinolib__int_to_string_step(uint8_t number, Arduinolib__int_to_string_out *o);*/ - void Arduinolib__lcd_string_step(uint8_t lstring[], int line, Arduinolib__lcd_string_out *o); + void Arduinolib__lcd_int_step(uint8_t numb, int line, Arduinolib__lcd_int_out *o); -/*void Arduinolib__print_string_step(uint8_t lstring[], int line, Arduinolib__print_string_out *o);*/ - -/*void Arduinolib__print_int_step(uint8_t numb, int line, Arduinolib__print_int_out *o);*/ - #endif \ No newline at end of file diff --git a/lcd_hept/prog.ept b/lcd_hept/prog.ept index 2fecd5a..be1444e 100644 --- a/lcd_hept/prog.ept +++ b/lcd_hept/prog.ept @@ -24,11 +24,9 @@ let tel node main() returns () -var j : int; - start : bool; +var start : bool; let - j = 0 fby (j+1); - start = j < 1; + start = true fby false; () = lcd_init() when start; () = lcd_blink_msg ((2, 1, "hello world!", 0) when not start);