WIP
This commit is contained in:
parent
90d89c7fbe
commit
49383b1b32
68 changed files with 3385 additions and 610 deletions
49
App/application.h
Normal file
49
App/application.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* mainloop.h
|
||||
*
|
||||
* Created on: Sep 11, 2019
|
||||
* Author: abody
|
||||
*/
|
||||
|
||||
#ifndef MAINLOOP_H_
|
||||
#define MAINLOOP_H_
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void MainLoop();
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#include <f4ll_cpp/serialconsole.h>
|
||||
#include "globals.h"
|
||||
|
||||
struct GlobalsInitializer {
|
||||
GlobalsInitializer(SerialConsole<257> *console) {
|
||||
g_console = console;
|
||||
}
|
||||
};
|
||||
|
||||
class Application : public GlobalsInitializer, public SerialConsole<257>::ISerialConsoleCallback {
|
||||
public:
|
||||
Application();
|
||||
void Loop();
|
||||
|
||||
private:
|
||||
virtual void LineReceived(void *userParam, SerialConsole<257>::Buffer *buffer);
|
||||
virtual void TransmissionComplete(void *userParam, SerialConsole<257>::Buffer *buffer);
|
||||
|
||||
SerialConsole<257> m_console;
|
||||
volatile bool m_received = false;
|
||||
volatile SerialConsole<257>::Buffer *m_rcvdBuffer;
|
||||
|
||||
volatile bool m_transmitted = true;
|
||||
};
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
#endif /* MAINLOOP_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue