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