update rp2040 warnings

- remove "-Wno-stringop-overflow -Wno-array-bounds"
- skip -Wconversion for gcc 9 and prior
- suppress_tinyusb_warnings only when building with gcc 9 and below
This commit is contained in:
hathach
2022-06-28 16:27:44 +07:00
parent 83602ea123
commit 898b52be45
4 changed files with 37 additions and 32 deletions

View File

@@ -55,17 +55,19 @@ int main(void)
// with Serial0 as all lower case, Serial1 as all upper case
static void echo_serial_port(uint8_t itf, uint8_t buf[], uint32_t count)
{
uint8_t const case_diff = 'a' - 'A';
for(uint32_t i=0; i<count; i++)
{
if (itf == 0)
{
// echo back 1st port as lower case
if (isupper(buf[i])) buf[i] = (uint8_t) (buf[i] + 'a' - 'A');
if (isupper(buf[i])) buf[i] += case_diff;
}
else
{
// echo back 2nd port as upper case
if (islower(buf[i])) buf[i] = (uint8_t) (buf[i] - 'a' - 'A');
if (islower(buf[i])) buf[i] -= case_diff;
}
tud_cdc_n_write_char(itf, buf[i]);