A simple operating system for the ESP32-based M5StickC
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.

26 lines
417 B

4 years ago
#include <M5StickC.h>
#include "Util.h"
unsigned long millis_since(unsigned long timestamp)
{
unsigned long now = millis();
if (now < timestamp)
{
return (4294967295 - timestamp) + millis();
}
else
{
return millis() - timestamp;
}
}
unsigned int rgb_to_colour(unsigned long colour)
{
return M5.Lcd.color565(
(colour >> 16) & 0xFF,
(colour >> 8) & 0xFF,
(colour) & 0xFF
);
}