49 lines
934 B
C++
49 lines
934 B
C++
/*
|
|
* 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_ */
|