Added test for number conversion
This commit is contained in:
parent
dafb7ee059
commit
2ba032c103
@ -57,7 +57,7 @@ void newUartUsage2()
|
||||
void newUartStreamOverloads()
|
||||
{
|
||||
using namespace uart;
|
||||
Uart1<> serial;
|
||||
Uart1<Config<115200>> serial;
|
||||
serial.init();
|
||||
sei();
|
||||
|
||||
@ -90,6 +90,24 @@ void newUartStreamOverloads()
|
||||
serial << F("unsigned long long : ") << ullVal << F("\r\n");
|
||||
serial << F("const void : ") << &bVal << F("\r\n");
|
||||
|
||||
auto number = 0xBADF00D;
|
||||
|
||||
serial << F("Binary : 0b");
|
||||
serial.txNumber<decltype(number), 2>(number);
|
||||
serial << F("\r\n");
|
||||
|
||||
serial << F("Octal : 0");
|
||||
serial.txNumber<decltype(number), 8>(number);
|
||||
serial << F("\r\n");
|
||||
|
||||
serial << F("Decimal : ");
|
||||
serial.txNumber<decltype(number), 10>(number);
|
||||
serial << F("\r\n");
|
||||
|
||||
serial << F("Hex : 0x");
|
||||
serial.txNumber<decltype(number), 16>(number);
|
||||
serial << F("\r\n");
|
||||
|
||||
_delay_ms(1000);
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 8d07e2d4db6f0fafebb00db7993b43b49aee30fc
|
||||
Subproject commit b6c1c3b51b44b3d7cb32e7f5f0222ecc155f8294
|
Loading…
Reference in New Issue
Block a user