Skip to content

Commit

Permalink
PROGMEM fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sidoh committed Jul 3, 2019
1 parent a504a45 commit e572ca6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions lib/MiLight/PacketFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ void PacketFormatter::format(uint8_t const* packet, char* buffer) {
}

void PacketFormatter::formatV1Packet(uint8_t const* packet, char* buffer) {
buffer += sprintf_P(buffer, "Request type : %02X\n", packet[0]) ;
buffer += sprintf_P(buffer, "Device ID : %02X%02X\n", packet[1], packet[2]);
buffer += sprintf_P(buffer, "b1 : %02X\n", packet[3]);
buffer += sprintf_P(buffer, "b2 : %02X\n", packet[4]);
buffer += sprintf_P(buffer, "b3 : %02X\n", packet[5]);
buffer += sprintf_P(buffer, "Sequence Num. : %02X", packet[6]);
buffer += sprintf_P(buffer, PSTR("Request type : %02X\n"), packet[0]) ;
buffer += sprintf_P(buffer, PSTR("Device ID : %02X%02X\n"), packet[1], packet[2]);
buffer += sprintf_P(buffer, PSTR("b1 : %02X\n"), packet[3]);
buffer += sprintf_P(buffer, PSTR("b2 : %02X\n"), packet[4]);
buffer += sprintf_P(buffer, PSTR("b3 : %02X\n"), packet[5]);
buffer += sprintf_P(buffer, PSTR("Sequence Num. : %02X"), packet[6]);
}

size_t PacketFormatter::getPacketLength() const {
Expand Down
10 changes: 5 additions & 5 deletions lib/MiLight/RgbPacketFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ BulbId RgbPacketFormatter::parsePacket(const uint8_t* packet, JsonObject result)
}

void RgbPacketFormatter::format(uint8_t const* packet, char* buffer) {
buffer += sprintf_P(buffer, "b0 : %02X\n", packet[0]);
buffer += sprintf_P(buffer, "ID : %02X%02X\n", packet[1], packet[2]);
buffer += sprintf_P(buffer, "Color : %02X\n", packet[3]);
buffer += sprintf_P(buffer, "Command : %02X\n", packet[4]);
buffer += sprintf_P(buffer, "Sequence : %02X\n", packet[5]);
buffer += sprintf_P(buffer, PSTR("b0 : %02X\n"), packet[0]);
buffer += sprintf_P(buffer, PSTR("ID : %02X%02X\n"), packet[1], packet[2]);
buffer += sprintf_P(buffer, PSTR("Color : %02X\n"), packet[3]);
buffer += sprintf_P(buffer, PSTR("Command : %02X\n"), packet[4]);
buffer += sprintf_P(buffer, PSTR("Sequence : %02X\n"), packet[5]);
}

0 comments on commit e572ca6

Please sign in to comment.