mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-26 12:05:36 +01:00
Add 2 tests about spd serial.
This commit is contained in:
parent
400640b902
commit
cb51add9aa
@ -293,6 +293,10 @@ int printf_lite_tests(void)
|
||||
Test1arg(F("|00012|"), F("|%05d|"), 12);
|
||||
Test1arg(F("|00012|"), F("|%05u|"), 12);
|
||||
Test1arg(F("|0000c|"), F("|%05x|"), 12);
|
||||
Test1arg(F("|0A|"), F("|%02X|"), (uint8_t)0xa);
|
||||
#define SMST(a) ((UINT8)((a & 0xf0) >> 4))
|
||||
#define SLST(a) ((UINT8)(a & 0x0f))
|
||||
testPrintf("spd", "00000F0F04070408", strlen("00000F0F04070408"), "%02X%02X%02X%02X%02X%02X%02X%02X", SMST(0x00) , SLST(0x00), SMST(0xFF), SLST(0xFF), SMST(0x147), SLST(0x147), SMST(0x148), SLST(0x148));
|
||||
|
||||
|
||||
Test1arg(F("|0A23|"), F("|%04X|"), 0xa23);
|
||||
|
@ -248,6 +248,10 @@ int printlib_tests(void)
|
||||
Test1arg(F("|1234|"), F("|%2u|"), 1234); // keep under 16 bit value, if not, on 16 bits CPU, the constant become long int and doesn't match %d
|
||||
Test1arg(F("|ABFE|"), F("|%2x|"), 0xABFE); // %x for PrintLib is %X for printf
|
||||
Test1arg(F("|ABFE|"), F("|%2X|"), 0xABFE);
|
||||
Test1arg(F("|0A|"), F("|%2X|"), (uint8_t)0xa);
|
||||
#define SMST(a) ((UINT8)((a & 0xf0) >> 4))
|
||||
#define SLST(a) ((UINT8)(a & 0x0f))
|
||||
testPrintf("spd", "00000F0F04070408", strlen("00000F0F04070408"), "%2X%2X%2X%2X%2X%2X%2X%2X", SMST(0x00) , SLST(0x00), SMST(0xFF), SLST(0xFF), SMST(0x147), SLST(0x147), SMST(0x148), SLST(0x148));
|
||||
|
||||
Test1arg(F("|12345|"), F("|%2X|"), 0x12345);
|
||||
Test1arg(F("|12345|"), F("|%4X|"), 0x12345);
|
||||
|
Loading…
Reference in New Issue
Block a user