Kinda works
This commit is contained in:
parent
f3d345e2e3
commit
662a7a9b12
40 changed files with 2851 additions and 26 deletions
60
Application/application.h
Normal file
60
Application/application.h
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* mainloop.h
|
||||
*
|
||||
* Created on: Sep 11, 2019
|
||||
* Author: abody
|
||||
*/
|
||||
|
||||
#ifndef MAINLOOP_H_
|
||||
#define MAINLOOP_H_
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void AppInit();
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#include <f4ll_cpp/serialconsole.h>
|
||||
#include <fsl/task.h>
|
||||
#include "../Application/globals.h"
|
||||
|
||||
struct GlobalsInitializer {
|
||||
GlobalsInitializer(f4ll_cpp::SerialConsole<257> *console) {
|
||||
g_console = console;
|
||||
}
|
||||
};
|
||||
|
||||
#define APPLICATION_STACK_SIZE 16384
|
||||
|
||||
class Application : public GlobalsInitializer
|
||||
, public f4ll_cpp::SerialConsole<257>::ISerialConsoleCallback
|
||||
, public fsl::Task<Application, APPLICATION_STACK_SIZE>
|
||||
{
|
||||
public:
|
||||
Application();
|
||||
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);
|
||||
virtual char const * getName() { return "Application"; }
|
||||
|
||||
f4ll_cpp::SerialConsole<257> m_console;
|
||||
volatile bool m_lineReceived = false;
|
||||
volatile f4ll_cpp::SerialConsole<257>::Buffer *m_rcvdBuffer;
|
||||
char m_appBuffer[128];
|
||||
|
||||
volatile bool m_transmissionCompleted = true;
|
||||
};
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
#endif /* MAINLOOP_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue