FreeRTOS f*ckery
This commit is contained in:
parent
4e45521e52
commit
4e9d7b1334
8 changed files with 122 additions and 13 deletions
|
@ -17,11 +17,24 @@
|
|||
|
||||
using namespace f4ll_cpp;
|
||||
|
||||
TaskHandle_t g_handle;
|
||||
StaticTask_t g_tcb;
|
||||
StackType_t g_stack[200];
|
||||
|
||||
void TaskFn(void * param)
|
||||
{
|
||||
for(;;) {
|
||||
vTaskDelay(100);
|
||||
}
|
||||
}
|
||||
|
||||
void MainLoop()
|
||||
{
|
||||
Application m;
|
||||
|
||||
m.Loop();
|
||||
// Application m;
|
||||
//
|
||||
// m.Start();
|
||||
g_handle = xTaskCreateStatic(TaskFn, "lofasz", sizeof(g_stack)/sizeof(g_stack[0]),
|
||||
nullptr, 5, g_stack, &g_tcb);
|
||||
}
|
||||
|
||||
#define CMD_X_READ 0b10010000
|
||||
|
@ -51,10 +64,16 @@ uint16_t ReadTouch(SPI_TypeDef *spi, bool x)
|
|||
|
||||
Application::Application()
|
||||
: GlobalsInitializer(&m_console)
|
||||
, Task(3)
|
||||
, m_console(USART1, DMA2, LL_DMA_STREAM_2, LL_DMA_STREAM_7, this, nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
void Application::TaskFn(void *taskObj)
|
||||
{
|
||||
static_cast<Application*>(reinterpret_cast<fsl::Task<Application, 1024>*>(taskObj))->Loop();
|
||||
}
|
||||
|
||||
void Application::Loop()
|
||||
{
|
||||
Ili9341Fsmc &lcd(Ili9341Fsmc::Init(nullptr, nullptr, DMA2, LL_DMA_STREAM_4, false));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue