You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
712 B
44 lines
712 B
#include <M5StickC.h>
|
|
#include "PowerManagement.h"
|
|
#include "Kernel.h"
|
|
#include "Colours.h"
|
|
|
|
int count = 0;
|
|
int test_func(unsigned int signal)
|
|
{
|
|
M5.Lcd.fillScreen(TFT_DARKGREY);
|
|
M5.Lcd.setCursor(0, 0);
|
|
if (signal & SIGNAL_START)
|
|
{
|
|
M5.Lcd.setRotation(3);
|
|
M5.Lcd.print("Initializing...");
|
|
}
|
|
if (signal & SIGNAL_STOP)
|
|
{
|
|
M5.Lcd.print("Stopping");
|
|
return 255;
|
|
}
|
|
if (signal & SIGNAL_TICK)
|
|
{
|
|
count++;
|
|
M5.Lcd.print("Ran: ");
|
|
M5.Lcd.print(String(count));
|
|
M5.Lcd.print(" times");
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void setup()
|
|
{
|
|
M5.begin();
|
|
Kernel_setup();
|
|
PowerManagement_setup();
|
|
|
|
Kernel_start(&test_func, 1000);
|
|
}
|
|
|
|
void loop()
|
|
{
|
|
Kernel_tick();
|
|
PowerManagement_tick();
|
|
}
|
|
|