From 45fc69cee5ffae99fc83195fa97a61810515a09f Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 18 Sep 2018 14:02:11 -0300 Subject: [PATCH] Add option for long USB reset pulse --- Config.h | 3 +++ IOSTM.cpp | 5 +++++ configs/MMDVM_HS_Dual_Hat-12mhz.h | 3 +++ configs/MMDVM_HS_Dual_Hat.h | 3 +++ configs/MMDVM_HS_Hat-12mhz.h | 3 +++ configs/MMDVM_HS_Hat.h | 3 +++ configs/NanoDV_NPI.h | 3 +++ configs/NanoDV_USB.h | 3 +++ configs/Nano_hotSPOT.h | 3 +++ configs/ZUMspot_Libre.h | 3 +++ configs/ZUMspot_RPi.h | 3 +++ configs/ZUMspot_USB.h | 3 +++ configs/ZUMspot_duplex.h | 3 +++ configs/generic_duplex_gpio.h | 3 +++ configs/generic_gpio.h | 3 +++ version.h | 2 +- 16 files changed, 48 insertions(+), 1 deletion(-) diff --git a/Config.h b/Config.h index 79f26bf..8e42814 100644 --- a/Config.h +++ b/Config.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG // #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +#define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/IOSTM.cpp b/IOSTM.cpp index bb377c4..a78e091 100644 --- a/IOSTM.cpp +++ b/IOSTM.cpp @@ -303,8 +303,13 @@ void CIO::Init() GPIO_WriteBit(GPIOA, GPIO_Pin_11, Bit_RESET); GPIO_WriteBit(GPIOA, GPIO_Pin_12, Bit_RESET); +#if defined(LONG_USB_RESET) // 10 ms delay delay_us(10000U); +#else + volatile unsigned int delay; + for(delay = 0;delay<512;delay++); +#endif GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING; diff --git a/configs/MMDVM_HS_Dual_Hat-12mhz.h b/configs/MMDVM_HS_Dual_Hat-12mhz.h index 10a56a8..de8fe01 100644 --- a/configs/MMDVM_HS_Dual_Hat-12mhz.h +++ b/configs/MMDVM_HS_Dual_Hat-12mhz.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +// #define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/MMDVM_HS_Dual_Hat.h b/configs/MMDVM_HS_Dual_Hat.h index f2bc5cc..bebd7cf 100644 --- a/configs/MMDVM_HS_Dual_Hat.h +++ b/configs/MMDVM_HS_Dual_Hat.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +// #define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/MMDVM_HS_Hat-12mhz.h b/configs/MMDVM_HS_Hat-12mhz.h index 024e90e..53dc693 100644 --- a/configs/MMDVM_HS_Hat-12mhz.h +++ b/configs/MMDVM_HS_Hat-12mhz.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +// #define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/MMDVM_HS_Hat.h b/configs/MMDVM_HS_Hat.h index db065ab..bd94ea9 100644 --- a/configs/MMDVM_HS_Hat.h +++ b/configs/MMDVM_HS_Hat.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +// #define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/NanoDV_NPI.h b/configs/NanoDV_NPI.h index b0dab9a..8d735c9 100644 --- a/configs/NanoDV_NPI.h +++ b/configs/NanoDV_NPI.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +// #define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/NanoDV_USB.h b/configs/NanoDV_USB.h index 716a0dc..cf5dd13 100644 --- a/configs/NanoDV_USB.h +++ b/configs/NanoDV_USB.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +#define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/Nano_hotSPOT.h b/configs/Nano_hotSPOT.h index c2620a1..db63bbf 100644 --- a/configs/Nano_hotSPOT.h +++ b/configs/Nano_hotSPOT.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG // #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +// #define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/ZUMspot_Libre.h b/configs/ZUMspot_Libre.h index 79f26bf..8e42814 100644 --- a/configs/ZUMspot_Libre.h +++ b/configs/ZUMspot_Libre.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG // #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +#define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/ZUMspot_RPi.h b/configs/ZUMspot_RPi.h index 9d32502..134789b 100644 --- a/configs/ZUMspot_RPi.h +++ b/configs/ZUMspot_RPi.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG // #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +// #define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/ZUMspot_USB.h b/configs/ZUMspot_USB.h index 9d5e239..712697c 100644 --- a/configs/ZUMspot_USB.h +++ b/configs/ZUMspot_USB.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG // #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +#define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/ZUMspot_duplex.h b/configs/ZUMspot_duplex.h index e1bace7..dc8c3a4 100644 --- a/configs/ZUMspot_duplex.h +++ b/configs/ZUMspot_duplex.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG // #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +#define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/generic_duplex_gpio.h b/configs/generic_duplex_gpio.h index b5b1364..4fd47e4 100644 --- a/configs/generic_duplex_gpio.h +++ b/configs/generic_duplex_gpio.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG // #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +// #define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/configs/generic_gpio.h b/configs/generic_gpio.h index 3f6813a..d9307ec 100644 --- a/configs/generic_gpio.h +++ b/configs/generic_gpio.h @@ -89,6 +89,9 @@ // Use the D-Star and DMR LEDs for POCSAG // #define USE_ALTERNATE_POCSAG_LEDS +// Enable for RPi 3B+, USB mode +// #define LONG_USB_RESET + // Enable modem debug messages // #define ENABLE_DEBUG diff --git a/version.h b/version.h index 414d4d7..6f4b02d 100644 --- a/version.h +++ b/version.h @@ -25,7 +25,7 @@ #define VER_MAJOR "1" #define VER_MINOR "4" #define VER_REV "8" -#define VERSION_DATE "20180908" +#define VERSION_DATE "20180918" #if defined(ZUMSPOT_ADF7021) #define BOARD_INFO "ZUMspot"