Merge branch '2.3' into 2.4

# Conflicts:
#	radio/src/fonts/480x272/font_dblsize.png
#	radio/src/fonts/480x272/font_xxlsize.png
#	radio/src/gui/128x64/model_setup.cpp
#	radio/src/gui/128x64/radio_setup.cpp
#	radio/src/gui/480x272/model_receiver_options.cpp
#	radio/src/gui/480x272/model_setup.cpp
#	radio/src/gui/480x272/radio_calibration.cpp
#	radio/src/gui/480x272/radio_hardware.cpp
#	radio/src/gui/common/stdlcd/draw_functions.cpp
#	radio/src/gui/gui_common.cpp
#	radio/src/keys.h
#	radio/src/lua/interface.cpp
#	radio/src/pulses/afhds3.h
#	radio/src/rtos.h
#	radio/src/switches.cpp
#	radio/src/targets/common/arm/stm32/aux_serial_driver.cpp
#	radio/src/targets/horus/CMakeLists.txt
#	radio/src/targets/horus/lcd_driver.cpp
#	radio/src/targets/horus/startup_stm32f42_43xxx.s
#	radio/src/targets/taranis/CMakeLists.txt
#	radio/src/telemetry/crossfire.h
#	radio/src/telemetry/multi.cpp
#	radio/src/translations.cpp
#	radio/src/translations/it.h.txt
#	radio/src/translations/untranslated.h
#	radio/util/font2png.py
#	tools/commit-tests.sh
This commit is contained in:
3djc
2021-04-08 11:42:28 +02:00
270 changed files with 10874 additions and 6174 deletions
+29 -5
View File
@@ -37,7 +37,9 @@ extern "C++" {
typedef pthread_t RTOS_TASK_HANDLE;
typedef pthread_mutex_t RTOS_MUTEX_HANDLE;
typedef uint32_t RTOS_FLAG_HANDLE;
typedef sem_t * RTOS_EVENT_HANDLE;
extern uint64_t simuTimerMicros(void);
@@ -77,16 +79,26 @@ extern "C++" {
pthread_mutex_unlock(&mutex);
}
static inline void RTOS_CREATE_FLAG(uint32_t &flag)
static inline void RTOS_CREATE_FLAG(RTOS_FLAG_HANDLE flag)
{
flag = 0; // TODO: real flags (use semaphores?)
}
static inline void RTOS_SET_FLAG(uint32_t &flag)
static inline void RTOS_SET_FLAG(RTOS_FLAG_HANDLE flag)
{
flag = 1;
}
static inline void RTOS_CLEAR_FLAG(RTOS_FLAG_HANDLE flag)
{
}
static inline bool RTOS_WAIT_FLAG(RTOS_FLAG_HANDLE flag, uint32_t timeout)
{
simuSleep(timeout);
return false;
}
#define RTOS_ISR_SET_FLAG RTOS_SET_FLAG
template<int SIZE>
class FakeTaskStack
{
@@ -147,6 +159,7 @@ template<int SIZE>
{
return (uint32_t)(simuTimerMicros() / 1000);
}
#elif defined(RTOS_COOS)
#ifdef __cplusplus
extern "C" {
@@ -156,7 +169,7 @@ template<int SIZE>
}
#endif
#define RTOS_MS_PER_TICK ((CPU_FREQ / CFG_SYSTICK_FREQ) / (CPU_FREQ / 1000)) // RTOS timer tick length in ms (currently 2)
#define RTOS_MS_PER_TICK (1000 / CFG_SYSTICK_FREQ) // RTOS timer tick length in ms (currently 1 for STM32, 2 for others)
typedef OS_TID RTOS_TASK_HANDLE;
typedef OS_MutexID RTOS_MUTEX_HANDLE;
@@ -231,6 +244,17 @@ template<int SIZE>
#define RTOS_CREATE_FLAG(flag) flag = CoCreateFlag(false, false)
#define RTOS_SET_FLAG(flag) (void)CoSetFlag(flag)
#define RTOS_CLEAR_FLAG(flag) (void)CoClearFlag(flag)
#define RTOS_WAIT_FLAG(flag,timeout) (CoWaitForSingleFlag(flag,timeout) == E_TIMEOUT)
static inline void RTOS_ISR_SET_FLAG(RTOS_FLAG_HANDLE flag)
{
CoEnterISR();
CoSchedLock();
isr_SetFlag(flag);
CoSchedUnlock();
CoExitISR();
}
#ifdef __cplusplus
template<int SIZE>