Some fixes for simu
This commit is contained in:
@@ -571,7 +571,7 @@ if(NOT MSVC)
|
||||
set(RADIO_DEPENDENCIES ${RADIO_DEPENDENCIES} bootloader)
|
||||
endif()
|
||||
|
||||
add_definitions(-DRTOS_COOS)
|
||||
add_definitions(-DFREE_RTOS)
|
||||
|
||||
add_executable(firmware ${SRC} ${FIRMWARE_HEADERS})
|
||||
link_libraries(firmware -lstdc++)
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
to exclude the API function. */
|
||||
//#define INCLUDE_vTaskPrioritySet 1
|
||||
//#define INCLUDE_uxTaskPriorityGet 1
|
||||
//#define INCLUDE_vTaskDelete 1
|
||||
#define INCLUDE_vTaskDelete 1
|
||||
//#define INCLUDE_vTaskCleanUpResources 1
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <stdio.h>
|
||||
#include "opentx.h"
|
||||
#include "lua_api.h"
|
||||
#include "timers.h"
|
||||
#include "../timers.h"
|
||||
#include "model_init.h"
|
||||
|
||||
/*luadoc
|
||||
|
||||
@@ -1917,10 +1917,13 @@ int main()
|
||||
initialise_monitor_handles();
|
||||
#endif
|
||||
|
||||
#if defined(STM32)
|
||||
|
||||
#if !defined(SIMU)
|
||||
/* Ensure all priority bits are assigned as preemption priority bits. */
|
||||
NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );
|
||||
#endif
|
||||
|
||||
#if defined(STM32)
|
||||
TRACE("reusableBuffer: modelSel=%d, moduleSetup=%d, calib=%d, sdManager=%d, hardwareAndSettings=%d, spectrumAnalyser=%d, usb=%d",
|
||||
sizeof(reusableBuffer.modelsel),
|
||||
sizeof(reusableBuffer.moduleSetup),
|
||||
|
||||
+5
-5
@@ -119,9 +119,9 @@ extern "C++" {
|
||||
};
|
||||
#define RTOS_DEFINE_STACK(name, size) FakeTaskStack<size> name
|
||||
|
||||
#define TASK_FUNCTION(task) void task(void *)
|
||||
#define TASK_FUNCTION(task) void* task(void *)
|
||||
|
||||
inline void RTOS_CREATE_TASK(pthread_t &taskId, void * task(void *), const char * name)
|
||||
inline void RTOS_CREATE_TASK(pthread_t &taskId, void * (*task)(void *), const char * name)
|
||||
{
|
||||
pthread_create(&taskId, nullptr, task, nullptr);
|
||||
#ifdef __linux__
|
||||
@@ -130,7 +130,7 @@ extern "C++" {
|
||||
}
|
||||
|
||||
template<int SIZE>
|
||||
inline void RTOS_CREATE_TASK(pthread_t &taskId, void * task(void *), const char * name, FakeTaskStack<SIZE> &, unsigned size = 0, unsigned priority = 0)
|
||||
inline void RTOS_CREATE_TASK(pthread_t &taskId, void * (*task)(void *), const char * name, FakeTaskStack<SIZE> &, unsigned size = 0, unsigned priority = 0)
|
||||
{
|
||||
UNUSED(size);
|
||||
UNUSED(priority);
|
||||
@@ -156,7 +156,7 @@ template<int SIZE>
|
||||
return (uint32_t)(simuTimerMicros() / 1000);
|
||||
}
|
||||
|
||||
#elif defined(RTOS_COOS)
|
||||
#elif defined(FREE_RTOS)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -324,7 +324,7 @@ template<int SIZE>
|
||||
#define RTOS_DEFINE_STACK(name, size) TaskStack<size> __ALIGNED(8) name __CCMRAM
|
||||
|
||||
#define TASK_FUNCTION(task) void task(void *)
|
||||
#define TASK_RETURN() return
|
||||
#define TASK_RETURN() vTaskDelete(nullptr)
|
||||
|
||||
#else // no RTOS
|
||||
static inline void RTOS_START()
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include "opentx.h"
|
||||
#include "timers.h"
|
||||
#include "../timers.h"
|
||||
#include "model_init.h"
|
||||
|
||||
void eeLoadModel(uint8_t index)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include "opentx.h"
|
||||
#include "timers.h"
|
||||
#include "../timers.h"
|
||||
#include "conversions/conversions.h"
|
||||
|
||||
uint8_t s_write_err = 0; // error reasons
|
||||
|
||||
@@ -22,15 +22,12 @@
|
||||
#include "mixer_scheduler.h"
|
||||
|
||||
RTOS_TASK_HANDLE menusTaskId;
|
||||
StaticTask_t menusTaskStruct;
|
||||
RTOS_DEFINE_STACK(menusStack, MENUS_STACK_SIZE);
|
||||
|
||||
RTOS_TASK_HANDLE mixerTaskId;
|
||||
StaticTask_t mixerTaskStruct;
|
||||
RTOS_DEFINE_STACK(mixerStack, MIXER_STACK_SIZE);
|
||||
|
||||
RTOS_TASK_HANDLE audioTaskId;
|
||||
StaticTask_t audioTaskStruct;
|
||||
RTOS_DEFINE_STACK(audioStack, AUDIO_STACK_SIZE);
|
||||
|
||||
RTOS_MUTEX_HANDLE audioMutex;
|
||||
|
||||
@@ -33,10 +33,17 @@
|
||||
#define AUDIO_STACK_SIZE 400
|
||||
#define CLI_STACK_SIZE 1000 // only consumed with CLI build option
|
||||
|
||||
#if defined(FREE_RTOS)
|
||||
#define MIXER_TASK_PRIO (tskIDLE_PRIORITY + 4)
|
||||
#define AUDIO_TASK_PRIO (tskIDLE_PRIORITY + 2)
|
||||
#define MENUS_TASK_PRIO (tskIDLE_PRIORITY + 1)
|
||||
#define CLI_TASK_PRIO (tskIDLE_PRIORITY + 1)
|
||||
#else
|
||||
#define MIXER_TASK_PRIO (4)
|
||||
#define AUDIO_TASK_PRIO (2)
|
||||
#define MENUS_TASK_PRIO (1)
|
||||
#define CLI_TASK_PRIO (1)
|
||||
#endif
|
||||
|
||||
extern RTOS_TASK_HANDLE menusTaskId;
|
||||
extern RTOS_DEFINE_STACK(menusStack, MENUS_STACK_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user