rework suppress_tinyusb_warnings

* gcc 9.2.1 has some spurious -Wconversion warnings
* cmake 3.18 and above require set_target_properties to be added from the target directory (so added it to all examples)
* fixed a few warnings in a couple of examples
This commit is contained in:
graham sanderson
2022-06-27 22:39:10 +01:00
parent 2f7f3e604e
commit 4057c2d8d9
3 changed files with 32 additions and 20 deletions

View File

@@ -60,12 +60,12 @@ static void echo_serial_port(uint8_t itf, uint8_t buf[], uint32_t count)
if (itf == 0)
{
// echo back 1st port as lower case
if (isupper(buf[i])) buf[i] += 'a' - 'A';
if (isupper(buf[i])) buf[i] = (uint8_t) (buf[i] + 'a' - 'A');
}
else
{
// echo back 2nd port as upper case
if (islower(buf[i])) buf[i] -= 'a' - 'A';
if (islower(buf[i])) buf[i] = (uint8_t) (buf[i] - 'a' - 'A');
}
tud_cdc_n_write_char(itf, buf[i]);

View File

@@ -230,7 +230,7 @@ void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint8_t
(void) instance;
(void) len;
uint8_t next_report_id = report[0] + 1;
uint8_t next_report_id = (uint8_t)(report[0] + 1);
if (next_report_id < REPORT_ID_COUNT)
{