diff options
| author | hathach <[email protected]> | 2024-07-23 19:53:41 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-07-23 19:53:41 +0700 |
| commit | c0f38ebf8d483da02a9074eaf021e1660a55fd75 (patch) | |
| tree | 570f1f4a1a08e48296f1d8ffb74ca0056a0e85b2 /hw | |
| parent | 5d26f5794e991409addfd9501ee04ad4e68dd1af (diff) | |
fsdev read/write packet use unaligned function
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/bsp/ch32v20x/family.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/bsp/ch32v20x/family.c b/hw/bsp/ch32v20x/family.c index 542d4b5db..43dd7e032 100644 --- a/hw/bsp/ch32v20x/family.c +++ b/hw/bsp/ch32v20x/family.c @@ -173,6 +173,17 @@ uint32_t board_button_read(void) { return false; } +size_t board_get_unique_id(uint8_t id[], size_t max_len) { + (void) max_len; + volatile uint32_t* ch32_uuid = ((volatile uint32_t*) 0x1FFFF7E8UL); + uint32_t* serial_32 = (uint32_t*) (uintptr_t) id; + serial_32[0] = ch32_uuid[0]; + serial_32[1] = ch32_uuid[1]; + serial_32[2] = ch32_uuid[2]; + + return 12; +} + int board_uart_read(uint8_t *buf, int len) { (void) buf; (void) len; |
