diff --git a/Defines.h b/Defines.h index 138451a..47e6fb5 100644 --- a/Defines.h +++ b/Defines.h @@ -129,9 +129,7 @@ typedef unsigned long long ulong64_t; // #define SEND_RSSI_DATA // Enable for RPi 3B+, USB mode -#if defined(STM32_USB_HOST) #define LONG_USB_RESET -#endif const uint8_t BIT_MASK_TABLE[] = { 0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02U, 0x01U }; diff --git a/IO.h b/IO.h index 181b4cb..d010199 100644 --- a/IO.h +++ b/IO.h @@ -42,17 +42,9 @@ // --------------------------------------------------------------------------- #if defined(DUPLEX) -#if defined(STM32_USB_HOST) #define CAL_DLY_LOOP 98950U #else -#define CAL_DLY_LOOP 96100U -#endif -#else -#if defined(STM32_USB_HOST) #define CAL_DLY_LOOP 110850U -#else -#define CAL_DLY_LOOP 104600U -#endif #endif enum ADF_GAIN_MODE { diff --git a/IOSTM.cpp b/IOSTM.cpp index 30d9e6d..010cf06 100644 --- a/IOSTM.cpp +++ b/IOSTM.cpp @@ -162,11 +162,7 @@ #define PIN_DEB GPIO_Pin_9 #define PORT_DEB GPIOB -#if defined(STM32_USB_HOST) #define PIN_NXDN_LED GPIO_Pin_1 -#else -#define PIN_NXDN_LED GPIO_Pin_7 -#endif #define PORT_NXDN_LED GPIOA #define PIN_DMR_LED GPIO_Pin_13 @@ -566,8 +562,7 @@ void IO::initInt() #endif -#if defined(STM32_USB_HOST) - // Pin PA11,PA12 = LOW, USB Reset + // Pin PA11,PA12 = LOW, USB Reset GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP; @@ -575,8 +570,6 @@ void IO::initInt() GPIO_WriteBit(GPIOA, GPIO_Pin_11, Bit_RESET); GPIO_WriteBit(GPIOA, GPIO_Pin_12, Bit_RESET); -#endif - #if defined(LONG_USB_RESET) // 10 ms delay delayUS(10000U); @@ -585,12 +578,6 @@ void IO::initInt() for (delay = 0; delay < 512; delay++); #endif -#if !defined(STM32_USB_HOST) - GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12; - GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING; - GPIO_Init(GPIOA, &GPIO_InitStruct); -#endif - RCC_USBCLKConfig(RCC_USBCLKSource_PLLCLK_1Div5); RCC_APB1PeriphClockCmd(RCC_APB1Periph_USB, ENABLE); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); diff --git a/SerialSTM.cpp b/SerialSTM.cpp index 89fee4b..53d4f8d 100644 --- a/SerialSTM.cpp +++ b/SerialSTM.cpp @@ -35,14 +35,7 @@ #if defined(STM32F10X_MD) #include - -#if defined(STM32_USB_HOST) #include -#endif - -#if defined(STM32_USART1_HOST) && defined(STM32_USB_HOST) -#error "You have to select STM32_USART1_HOST or STM32_USB_HOST, but not both" -#endif // --------------------------------------------------------------------------- // Constants @@ -279,11 +272,7 @@ void SerialPort::beginInt(uint8_t n, int speed) { switch (n) { case 1U: -#if defined(STM32_USART1_HOST) - InitUSART1(speed); -#elif defined(STM32_USB_HOST) usbserial.begin(); -#endif break; case 3U: InitUSART2(speed); @@ -302,11 +291,7 @@ int SerialPort::availableInt(uint8_t n) { switch (n) { case 1U: -#if defined(STM32_USART1_HOST) - return m_USART1.available(); -#elif defined(STM32_USB_HOST) return usbserial.available(); -#endif case 3U: m_USART2.available(); default: @@ -323,12 +308,8 @@ int SerialPort::availableForWriteInt(uint8_t n) { switch (n) { case 1U: -#if defined(STM32_USART1_HOST) - return m_USART1.availableForWrite(); -#elif defined(STM32_USB_HOST) //return usbserial.availableForWrite(); return 1U; // we don't have this -- so fake it -#endif case 3U: return m_USART2.availableForWrite(); default: @@ -345,11 +326,7 @@ uint8_t SerialPort::readInt(uint8_t n) { switch (n) { case 1U: -#if defined(STM32_USART1_HOST) - return m_USART1.read(); -#elif defined(STM32_USB_HOST) return usbserial.read(); -#endif case 3U: return m_USART2.read(); default: @@ -369,15 +346,9 @@ void SerialPort::writeInt(uint8_t n, const uint8_t* data, uint16_t length, bool { switch (n) { case 1U: -#if defined(STM32_USART1_HOST) - m_USART1.write(data, length); - if (flush) - m_USART1.flush(); -#elif defined(STM32_USB_HOST) usbserial.write(data, length); if (flush) usbserial.flush(); -#endif break; case 3U: m_USART2.write(data, length);