From 98b7d75aebcb1514f4bab0327ce6f63d9e96a7e0 Mon Sep 17 00:00:00 2001 From: Ole Artz Date: Thu, 9 Jun 2022 13:05:15 +0200 Subject: [PATCH] LANTelnetToI2C_Board: fix some typos --- atmega32u4/dcdc_mdc/main.c | 20 +++++++++++++++---- .../LANTelnetToI2C_Board.ino | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/atmega32u4/dcdc_mdc/main.c b/atmega32u4/dcdc_mdc/main.c index 49b8f30..a203613 100644 --- a/atmega32u4/dcdc_mdc/main.c +++ b/atmega32u4/dcdc_mdc/main.c @@ -287,7 +287,7 @@ in one command.) void getdata(uint8_t buf) { // handle the incoming command and call the correct function - if (rxcnt != 0 || (buf == 'A' || buf = 'S' || buf == 'W' || buf == 'R')) { + if (rxcnt != 0 || (buf == 'A' || buf == 'S' || buf == 'W' || buf == 'R')) { rxbuf[rxcnt++] = buf; } if (buf == '\n' || buf == '\r') { // End of Command @@ -443,7 +443,7 @@ void getdata(uint8_t buf) { if (hex_to_int(rxbuf[3]) == 0) { V_out = (5 * adc[10]) / 2; // 2.5 (5/2) stepsize of adc send_answer_hex(&rxbuf[0], V_out); - }CSR1B |= (1 << UDRIE1); } + } // DCDC 1 if (hex_to_int(rxbuf[3]) == 1) { V_out = (5 * adc[7]) / 2; @@ -455,7 +455,7 @@ void getdata(uint8_t buf) { send_answer_hex(&rxbuf[0], V_out); } // DCDC 3 - if (hex_to_int(rxbuf[3]) == 2) { + if (hex_to_int(rxbuf[3]) == 3) { V_out = (5 * adc[4]) / 2; send_answer_hex(&rxbuf[0], V_out); } @@ -587,10 +587,22 @@ __attribute__((naked)) void main(void) { // ADCSRA |= (1<> 8); + eeprom_update_byte((uint8_t *)0x23, shift_register >> 16); + eeprom_update_byte((uint8_t *)0x24, shift_register >> 24); + */ + shift_register = eeprom_read_byte((uint8_t *)0x21) | eeprom_read_byte((uint8_t *)0x22) << 8 | (uint32_t)eeprom_read_byte((uint8_t *)0x23) << 16 | (uint32_t)eeprom_read_byte((uint8_t *)0x24) << 24; + + //shift_register = 0xffffffff; //default value + // to read dcdc switch to control the channel LEDs if (shift_register & (uint32_t)1 << 4) { LED_CH0_ON(); @@ -607,7 +619,7 @@ __attribute__((naked)) void main(void) { // curr_offset = eeprom_read_byte((uint8_t*)0x26); -// shift_register = 0xffffffff; //default value + setVoltages(); LED1_ON(); // board status - ready to use diff --git a/esp32/EthernetUART/LANTelnetToI2C_Board/LANTelnetToI2C_Board.ino b/esp32/EthernetUART/LANTelnetToI2C_Board/LANTelnetToI2C_Board.ino index fe631d5..ebd1dee 100644 --- a/esp32/EthernetUART/LANTelnetToI2C_Board/LANTelnetToI2C_Board.ino +++ b/esp32/EthernetUART/LANTelnetToI2C_Board/LANTelnetToI2C_Board.ino @@ -349,8 +349,8 @@ void show_CH(String unit) { display.setCursor(SCREEN_WIDTH * 11 / 28, SCREEN_HEIGHT * 2 / 5); } display.print(unit); - delay(1000); display.display(); + delay(1000); //pause for 1 s } void show_VAL(int dadc0, int dadc1, int dadc2, int dadc3, String unit) { -- 2.43.0