summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-07-14 15:04:38 +0700
committerhathach <[email protected]>2021-07-14 15:04:38 +0700
commitac8d0abecf93af2498f9d5d1438c2af7b133bedc (patch)
tree08d5039c951d18f0784252e21ebe352aa67bcd1d /examples/device
parent86d511f24452b13c8e5779c7a79bff54a03dafd8 (diff)
rename dfu API
- tud_dfu_dnload_complete() -> tud_dfu_download_complete() - tud_dfu_req_dnload_data_cb() -> tud_dfu_download_cb() - tud_dfu_req_upload_data_cb() -> tud_dfu_upload_cb()
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/dfu/src/main.c6
-rw-r--r--examples/device/midi_test/src/main.c10
2 files changed, 10 insertions, 6 deletions
diff --git a/examples/device/dfu/src/main.c b/examples/device/dfu/src/main.c
index 4ec6d477c..8e7fa9ee0 100644
--- a/examples/device/dfu/src/main.c
+++ b/examples/device/dfu/src/main.c
@@ -135,7 +135,7 @@ uint32_t tud_dfu_get_status_cb(uint8_t alt, uint8_t state)
return 0;
}
-void tud_dfu_req_dnload_data_cb(uint8_t alt, uint16_t wBlockNum, uint8_t* data, uint16_t length)
+void tud_dfu_download_cb(uint8_t alt, uint16_t wBlockNum, uint8_t* data, uint16_t length)
{
(void) data;
printf(" Received Alt %u BlockNum %u of length %u\r\n", alt, wBlockNum, length);
@@ -147,7 +147,7 @@ void tud_dfu_req_dnload_data_cb(uint8_t alt, uint16_t wBlockNum, uint8_t* data,
}
#endif
- tud_dfu_dnload_complete();
+ tud_dfu_download_complete();
}
bool tud_dfu_device_data_done_check_cb(uint8_t alt)
@@ -167,7 +167,7 @@ void tud_dfu_abort_cb(uint8_t alt)
const uint8_t upload_test[2][UPLOAD_SIZE] = {"Hello world from TinyUSB DFU! - Partition 0",
"Hello world from TinyUSB DFU! - Partition 1"};
-uint16_t tud_dfu_req_upload_data_cb(uint8_t alt, uint16_t block_num, uint8_t* data, uint16_t length)
+uint16_t tud_dfu_upload_cb(uint8_t alt, uint16_t block_num, uint8_t* data, uint16_t length)
{
(void) block_num;
(void) length;
diff --git a/examples/device/midi_test/src/main.c b/examples/device/midi_test/src/main.c
index 9e0e82a10..66b858323 100644
--- a/examples/device/midi_test/src/main.c
+++ b/examples/device/midi_test/src/main.c
@@ -134,10 +134,13 @@ void midi_task(void)
uint8_t packet[4];
while ( tud_midi_available() ) tud_midi_packet_read(packet);
- // send note every 1000 ms
- if (board_millis() - start_ms < 286) return; // not enough time
- start_ms += 286;
+ // send note periodically
+ if (board_millis() - start_ms < 1000) return; // not enough time
+ start_ms += 1000;
+#if 1
+
+#else
// Previous positions in the note sequence.
int previous = note_pos - 1;
@@ -158,6 +161,7 @@ void midi_task(void)
// If we are at the end of the sequence, start over.
if (note_pos >= sizeof(note_sequence)) note_pos = 0;
+#endif
}
//--------------------------------------------------------------------+