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.
25 lines
417 B
25 lines
417 B
#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
|
|
);
|
|
}
|
|
|