More elegant fsl::Task implementation
This commit is contained in:
parent
7eedbfdf9b
commit
0111f3d210
9 changed files with 301 additions and 19 deletions
|
@ -53,15 +53,15 @@ uint16_t ReadTouch(SPI_TypeDef *spi, bool x)
|
|||
|
||||
Application::Application()
|
||||
: GlobalsInitializer(&m_console)
|
||||
, Task(3)
|
||||
, Task(3, &Application::Loop)
|
||||
, 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, APPLICATION_STACK_SIZE>*>(taskObj))->Loop();
|
||||
}
|
||||
//void Application::TaskFn(void *taskObj)
|
||||
//{
|
||||
// static_cast<Application*>(reinterpret_cast<fsl::Task<Application, APPLICATION_STACK_SIZE>*>(taskObj))->Loop();
|
||||
//}
|
||||
|
||||
void Application::Loop()
|
||||
{
|
||||
|
|
|
@ -37,11 +37,10 @@ class Application : public GlobalsInitializer
|
|||
{
|
||||
public:
|
||||
Application();
|
||||
void Loop();
|
||||
void Loop();
|
||||
|
||||
friend class fsl::Task<Application, APPLICATION_STACK_SIZE>;
|
||||
private:
|
||||
static void TaskFn(void *taskObj);
|
||||
|
||||
virtual void LineReceived(void *userParam, f4ll_cpp::SerialConsole<257>::Buffer *buffer);
|
||||
virtual void TransmissionComplete(void *userParam, f4ll_cpp::SerialConsole<257>::Buffer *buffer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue