From 956eb2043a9367296af7bd9b725f1971af48efa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 13 Mar 2021 16:18:34 +0100 Subject: [PATCH 1/4] hw/misc/led: Add yellow LED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the yellow "lime" LED. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Michael Rolnik Message-Id: <20210313165445.2113938-2-f4bug@amsat.org> --- hw/misc/led.c | 1 + include/hw/misc/led.h | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/misc/led.c b/hw/misc/led.c index 5266d026d0..f552b8b648 100644 --- a/hw/misc/led.c +++ b/hw/misc/led.c @@ -20,6 +20,7 @@ static const char * const led_color_name[] = { [LED_COLOR_BLUE] = "blue", [LED_COLOR_CYAN] = "cyan", [LED_COLOR_GREEN] = "green", + [LED_COLOR_YELLOW] = "yellow", [LED_COLOR_AMBER] = "amber", [LED_COLOR_ORANGE] = "orange", [LED_COLOR_RED] = "red", diff --git a/include/hw/misc/led.h b/include/hw/misc/led.h index aa359b87c2..29c0879570 100644 --- a/include/hw/misc/led.h +++ b/include/hw/misc/led.h @@ -27,6 +27,7 @@ typedef enum { /* Coarse wavelength range */ LED_COLOR_BLUE, /* 475 nm */ LED_COLOR_CYAN, /* 500 nm */ LED_COLOR_GREEN, /* 535 nm */ + LED_COLOR_YELLOW, /* 567 nm */ LED_COLOR_AMBER, /* 590 nm */ LED_COLOR_ORANGE, /* 615 nm */ LED_COLOR_RED, /* 630 nm */ From 15991968a072bca0f73eaa7929273afd80f70979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 13 Mar 2021 16:18:19 +0100 Subject: [PATCH 2/4] hw/avr/arduino: List board schematic links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Michael Rolnik Message-Id: <20210313165445.2113938-3-f4bug@amsat.org> --- hw/avr/arduino.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/hw/avr/arduino.c b/hw/avr/arduino.c index 3c8388490d..3ff31492fa 100644 --- a/hw/avr/arduino.c +++ b/hw/avr/arduino.c @@ -75,7 +75,10 @@ static void arduino_duemilanove_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc); - /* https://www.arduino.cc/en/Main/ArduinoBoardDuemilanove */ + /* + * https://www.arduino.cc/en/Main/ArduinoBoardDuemilanove + * https://www.arduino.cc/en/uploads/Main/arduino-duemilanove-schematic.pdf + */ mc->desc = "Arduino Duemilanove (ATmega168)", mc->alias = "2009"; amc->mcu_type = TYPE_ATMEGA168_MCU; @@ -87,7 +90,10 @@ static void arduino_uno_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc); - /* https://store.arduino.cc/arduino-uno-rev3 */ + /* + * https://store.arduino.cc/arduino-uno-rev3 + * https://www.arduino.cc/en/uploads/Main/arduino-uno-schematic.pdf + */ mc->desc = "Arduino UNO (ATmega328P)"; mc->alias = "uno"; amc->mcu_type = TYPE_ATMEGA328_MCU; @@ -99,7 +105,10 @@ static void arduino_mega_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc); - /* https://www.arduino.cc/en/Main/ArduinoBoardMega */ + /* + * https://www.arduino.cc/en/Main/ArduinoBoardMega + * https://www.arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf + */ mc->desc = "Arduino Mega (ATmega1280)"; mc->alias = "mega"; amc->mcu_type = TYPE_ATMEGA1280_MCU; @@ -111,7 +120,10 @@ static void arduino_mega2560_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc); - /* https://store.arduino.cc/arduino-mega-2560-rev3 */ + /* + * https://store.arduino.cc/arduino-mega-2560-rev3 + * https://www.arduino.cc/en/uploads/Main/arduino-mega2560_R3-sch.pdf + */ mc->desc = "Arduino Mega 2560 (ATmega2560)"; mc->alias = "mega2560"; amc->mcu_type = TYPE_ATMEGA2560_MCU; From 2e35dfb634daba466adbc382da64e5fd4ce9d2ed Mon Sep 17 00:00:00 2001 From: Lichang Zhao Date: Fri, 9 Oct 2020 14:44:46 +0800 Subject: [PATCH 3/4] target/avr: Fix some comment spelling errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I found that there are many spelling errors in the comments of qemu/target/avr. I used spellcheck to check the spelling errors and found some errors in the folder. Signed-off-by: Lichang Zhao Reviewed-by: David Edmondson Reviewed-by: Philippe Mathieu-Daude Message-Id: <20201009064449.2336-12-zhaolichang@huawei.com> Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael Rolnik --- target/avr/helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/avr/helper.c b/target/avr/helper.c index 65880b9928..b4532de252 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -98,7 +98,7 @@ int avr_cpu_memory_rw_debug(CPUState *cs, vaddr addr, uint8_t *buf, hwaddr avr_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) { - return addr; /* I assume 1:1 address correspondance */ + return addr; /* I assume 1:1 address correspondence */ } bool avr_cpu_tlb_fill(CPUState *cs, vaddr address, int size, @@ -299,7 +299,7 @@ void helper_outb(CPUAVRState *env, uint32_t port, uint32_t data) } /* - * this function implements LD instruction when there is a posibility to read + * this function implements LD instruction when there is a possibility to read * from a CPU register */ target_ulong helper_fullrd(CPUAVRState *env, uint32_t addr) @@ -323,7 +323,7 @@ target_ulong helper_fullrd(CPUAVRState *env, uint32_t addr) } /* - * this function implements ST instruction when there is a posibility to write + * this function implements ST instruction when there is a possibility to write * into a CPU register */ void helper_fullwr(CPUAVRState *env, uint32_t data, uint32_t addr) From 56b90e60c4019b08012bd8bd1459efc00b055577 Mon Sep 17 00:00:00 2001 From: Ivanov Arkasha Date: Fri, 12 Mar 2021 19:47:54 +0300 Subject: [PATCH 4/4] target/avr: Fix interrupt execution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only one interrupt is in progress at the moment. It is only necessary to set to reset interrupt_request after all interrupts have been executed. Signed-off-by: Ivanov Arkasha Message-Id: <20210312164754.18437-1-arkaisp2021@gmail.com> Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael Rolnik --- target/avr/helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/avr/helper.c b/target/avr/helper.c index b4532de252..35e1019594 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -49,7 +49,9 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) cc->tcg_ops->do_interrupt(cs); env->intsrc &= env->intsrc - 1; /* clear the interrupt */ - cs->interrupt_request &= ~CPU_INTERRUPT_HARD; + if (!env->intsrc) { + cs->interrupt_request &= ~CPU_INTERRUPT_HARD; + } ret = true; }