Refactoring for stability, etc. Add new animation.
This commit is contained in:
@@ -21,7 +21,7 @@ void UDPLogger::set_name(String name)
|
||||
void UDPLogger::log_string(String message)
|
||||
{
|
||||
// wait 5 milliseconds if last send was less than 5 milliseconds before
|
||||
if (millis() < (_lastSend + 5))
|
||||
if ((system_get_time() / 1000) < (_lastSend + 5))
|
||||
{
|
||||
delay(5);
|
||||
}
|
||||
@@ -31,13 +31,13 @@ void UDPLogger::log_string(String message)
|
||||
message.toCharArray(_packetBuffer, 100);
|
||||
_udp.print(_packetBuffer);
|
||||
_udp.endPacket();
|
||||
_lastSend = millis();
|
||||
_lastSend = (system_get_time() / 1000);
|
||||
}
|
||||
|
||||
void UDPLogger::log_color_24bit(uint32_t color)
|
||||
{
|
||||
uint8_t result_red = color >> 16 & 0xff;
|
||||
uint8_t result_green = color >> 8 & 0xff;
|
||||
uint8_t result_blue = color & 0xff;
|
||||
uint8_t result_red = color >> 16 & UINT8_MAX;
|
||||
uint8_t result_green = color >> 8 & UINT8_MAX;
|
||||
uint8_t result_blue = color & UINT8_MAX;
|
||||
log_string(String(result_red) + ", " + String(result_green) + ", " + String(result_blue));
|
||||
}
|
||||
Reference in New Issue
Block a user