Horus fixes

This commit is contained in:
Raphael Coeffic
2022-06-11 15:38:08 +02:00
committed by Raphael Coeffic
parent cf06efea87
commit f6565c6826
15 changed files with 41 additions and 12 deletions
+4 -1
View File
@@ -24,12 +24,15 @@
#include "opentx.h" #include "opentx.h"
#include "diskio.h" #include "diskio.h"
#include "timers_driver.h"
#include "cli.h"
#include <ctype.h> #include <ctype.h>
#include <malloc.h> #include <malloc.h>
#include <new> #include <new>
#include <stdarg.h> #include <stdarg.h>
#include "cli.h"
#if defined(INTMODULE_USART) #if defined(INTMODULE_USART)
#include "intmodule_serial_driver.h" #include "intmodule_serial_driver.h"
@@ -20,6 +20,7 @@
*/ */
#include "opentx.h" #include "opentx.h"
#include "timers_driver.h"
extern uint8_t g_moduleIdx; extern uint8_t g_moduleIdx;
@@ -20,6 +20,7 @@
*/ */
#include "opentx.h" #include "opentx.h"
#include "timers_driver.h"
extern uint8_t g_moduleIdx; extern uint8_t g_moduleIdx;
@@ -158,4 +159,4 @@ void menuRadioSpectrumAnalyser(event_t event)
int offset = reusableBuffer.spectrumAnalyser.track - (reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2); int offset = reusableBuffer.spectrumAnalyser.track - (reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2);
int x = offset / reusableBuffer.spectrumAnalyser.step; int x = offset / reusableBuffer.spectrumAnalyser.step;
lcdDrawVerticalLine(x, 10+FH+1, LCD_H, SOLID); lcdDrawVerticalLine(x, 10+FH+1, LCD_H, SOLID);
} }
+1
View File
@@ -22,6 +22,7 @@
#include <stdio.h> #include <stdio.h>
#include "opentx.h" #include "opentx.h"
#include "bootloader_flash.h" #include "bootloader_flash.h"
#include "timers_driver.h"
#if defined(LIBOPENUI) #if defined(LIBOPENUI)
#include "libopenui.h" #include "libopenui.h"
+1
View File
@@ -23,6 +23,7 @@
#include "opentx.h" #include "opentx.h"
#include "frsky_firmware_update.h" #include "frsky_firmware_update.h"
#include "debug.h" #include "debug.h"
#include "timers_driver.h"
#if defined(LIBOPENUI) #if defined(LIBOPENUI)
#include "libopenui.h" #include "libopenui.h"
+12 -3
View File
@@ -74,9 +74,9 @@ bool MultiRfProtocols::RfProto::parse(const uint8_t* data, uint8_t len)
label = "Frsky"; label = "Frsky";
flags = 0x20; flags = 0x20;
subProtoNr = def->maxSubtype + 1;
subProtoLen = def->subTypeString[0]; fillSubProtoList(def->subTypeString, def->maxSubtype + 1);
s = def->subTypeString + 1; return true;
} else { } else {
// proto label string // proto label string
@@ -118,6 +118,15 @@ void MultiRfProtocols::RfProto::fillSubProtoList(const char* str, int n, int len
} }
} }
void MultiRfProtocols::RfProto::fillSubProtoList(const char** str, int n)
{
subProtos.reserve(n);
for (int i = 0; i < n; i++) {
subProtos.emplace_back(str[i]);
}
}
uint8_t MultiRfProtocols::RfProto::getOption() const uint8_t MultiRfProtocols::RfProto::getOption() const
{ {
uint8_t opt = flags >> 4; uint8_t opt = flags >> 4;
+5
View File
@@ -57,6 +57,11 @@ class MultiRfProtocols
RfProto(int proto) : proto(proto) {} RfProto(int proto) : proto(proto) {}
bool parse(const uint8_t* data, uint8_t len); bool parse(const uint8_t* data, uint8_t len);
// array of strings
void fillSubProtoList(const char** str, int n);
// fixed length strings concatenated
void fillSubProtoList(const char* str, int n, int len); void fillSubProtoList(const char* str, int n, int len);
uint8_t getOption() const; uint8_t getOption() const;
+1
View File
@@ -23,6 +23,7 @@
#include "io/frsky_firmware_update.h" #include "io/frsky_firmware_update.h"
#include "hal/adc_driver.h" #include "hal/adc_driver.h"
#include "aux_serial_driver.h" #include "aux_serial_driver.h"
#include "timers_driver.h"
#if defined(LIBOPENUI) #if defined(LIBOPENUI)
#include "libopenui.h" #include "libopenui.h"
+1
View File
@@ -26,6 +26,7 @@
#include "libopenui/src/libopenui_file.h" #include "libopenui/src/libopenui_file.h"
#include "mixer_scheduler.h" #include "mixer_scheduler.h"
#include "heartbeat_driver.h" #include "heartbeat_driver.h"
#include "timers_driver.h"
#if defined(INTMODULE_USART) #if defined(INTMODULE_USART)
#include "intmodule_serial_driver.h" #include "intmodule_serial_driver.h"
+1
View File
@@ -20,6 +20,7 @@
*/ */
#include "opentx.h" #include "opentx.h"
#include "timers_driver.h"
#if defined(MULTIMODULE) #if defined(MULTIMODULE)
#include "pulses/multi.h" #include "pulses/multi.h"
@@ -132,13 +132,6 @@ void delay_ms(uint32_t count);
} }
#endif #endif
#if !defined(BOOT)
void watchdogSuspend(uint32_t timeout);
#define WATCHDOG_SUSPEND(x) watchdogSuspend(x)
#else
#define WATCHDOG_SUSPEND(...)
#endif
#define INIT_KEYS_PINS(GPIO) \ #define INIT_KEYS_PINS(GPIO) \
GPIO_InitStructure.GPIO_Pin = KEYS_ ## GPIO ## _PINS; \ GPIO_InitStructure.GPIO_Pin = KEYS_ ## GPIO ## _PINS; \
GPIO_Init(GPIO, &GPIO_InitStructure) GPIO_Init(GPIO, &GPIO_InitStructure)
@@ -35,4 +35,6 @@ void stop1msTimer();
static inline uint16_t getTmr2MHz() { return TIMER_2MHz_TIMER->CNT; } static inline uint16_t getTmr2MHz() { return TIMER_2MHz_TIMER->CNT; }
void watchdogSuspend(uint32_t timeout);
#endif #endif
@@ -30,6 +30,7 @@ extern "C" {
#include "usbd_desc.h" #include "usbd_desc.h"
#include "usbd_usr.h" #include "usbd_usr.h"
#include "usbd_hid_core.h" #include "usbd_hid_core.h"
#include "usbd_cdc_core.h"
} }
#include "board.h" #include "board.h"
@@ -28,6 +28,13 @@
#include <string.h> #include <string.h>
#if !defined(BOOT)
#include "timers_driver.h"
#define WATCHDOG_SUSPEND(x) watchdogSuspend(x)
#else
#define WATCHDOG_SUSPEND(...)
#endif
#if defined(__cplusplus) && !defined(SIMU) #if defined(__cplusplus) && !defined(SIMU)
extern "C" { extern "C" {
#endif #endif
+2
View File
@@ -32,6 +32,8 @@
#include "sdcard.h" #include "sdcard.h"
#include "debug.h" #include "debug.h"
#include <string.h>
#if defined(AUX_SERIAL) || defined(AUX2_SERIAL) #if defined(AUX_SERIAL) || defined(AUX2_SERIAL)
#include "aux_serial_driver.h" #include "aux_serial_driver.h"
#endif #endif