From 9b3566c0afe00d114cdde57ed4c181571d47e27c Mon Sep 17 00:00:00 2001 From: Denis Ahrens Date: Fri, 15 Mar 2024 15:14:04 +0100 Subject: [PATCH] buspirate v4: detect the A6 revision --- Firmware/hardwarev4.h | 1 + Firmware/messages_v4.h | 2 ++ Firmware/messages_v4.s | 6 ++++++ Firmware/proc_menu.c | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/Firmware/hardwarev4.h b/Firmware/hardwarev4.h index 249c4b19..b97cf08b 100644 --- a/Firmware/hardwarev4.h +++ b/Firmware/hardwarev4.h @@ -176,6 +176,7 @@ #define PIC_REV_A3 0x0001 #define PIC_REV_A5 0x0003 +#define PIC_REV_A6 0x0004 static inline void bp_enable_usb_led(void) { BP_LEDUSB_DIR = OUTPUT; diff --git a/Firmware/messages_v4.h b/Firmware/messages_v4.h index 9a6a771d..a51ab2da 100644 --- a/Firmware/messages_v4.h +++ b/Firmware/messages_v4.h @@ -367,6 +367,8 @@ void MSG_CHIP_REVISION_A3_str(void); #define MSG_CHIP_REVISION_A3 bp_message_write_buffer(__builtin_tbladdress(MSG_CHIP_REVISION_A3_str)) void MSG_CHIP_REVISION_A5_str(void); #define MSG_CHIP_REVISION_A5 bp_message_write_buffer(__builtin_tbladdress(MSG_CHIP_REVISION_A5_str)) +void MSG_CHIP_REVISION_A6_str(void); +#define MSG_CHIP_REVISION_A6 bp_message_write_buffer(__builtin_tbladdress(MSG_CHIP_REVISION_A6_str)) void MSG_CHIP_REVISION_ID_BEGIN_str(void); #define MSG_CHIP_REVISION_ID_BEGIN bp_message_write_buffer(__builtin_tbladdress(MSG_CHIP_REVISION_ID_BEGIN_str)) void MSG_CHIP_REVISION_UNKNOWN_str(void); diff --git a/Firmware/messages_v4.s b/Firmware/messages_v4.s index f2d1e0ab..897342ee 100644 --- a/Firmware/messages_v4.s +++ b/Firmware/messages_v4.s @@ -1096,6 +1096,12 @@ _MSG_CHIP_REVISION_A3_str: _MSG_CHIP_REVISION_A5_str: .pasciz "A5" + ; MSG_CHIP_REVISION_A6 + .section .text.MSG_CHIP_REVISION_A6, code + .global _MSG_CHIP_REVISION_A6_str +_MSG_CHIP_REVISION_A6_str: + .pasciz "A6" + ; MSG_CHIP_REVISION_ID_BEGIN .section .text.MSG_CHIP_REVISION_ID_BEGIN, code .global _MSG_CHIP_REVISION_ID_BEGIN_str diff --git a/Firmware/proc_menu.c b/Firmware/proc_menu.c index e28861ef..98fae5ef 100644 --- a/Firmware/proc_menu.c +++ b/Firmware/proc_menu.c @@ -1452,6 +1452,10 @@ void print_version_info(void) { MSG_CHIP_REVISION_A5; break; + case PIC_REV_A6: + MSG_CHIP_REVISION_A6; + break; + default: MSG_CHIP_REVISION_UNKNOWN; break;