Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
added rp2040 unique id (requires submodule update)
Browse files Browse the repository at this point in the history
  • Loading branch information
majbthrd committed Feb 16, 2021
1 parent 7f1af42 commit 26039d8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if(FAMILY STREQUAL "rp2040")
target_compile_definitions(${PROJECT} PUBLIC
)

target_link_libraries(${PROJECT} pico_stdlib)
target_link_libraries(${PROJECT} pico_stdlib pico_fix_rp2040_usb_device_enumeration pico_unique_id)

pico_add_extra_outputs(${PROJECT})

Expand Down
25 changes: 25 additions & 0 deletions bsp/rp2040/unique.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <stdint.h>
#include "pico/stdlib.h"
#include "pico/unique_id.h"
#include "tusb.h"

static uint8_t get_unique_id(uint16_t *desc_str)
{
pico_unique_board_id_t uid;
uint8_t chr_count = 0;

pico_get_unique_board_id(&uid);

for (int byte = 0; byte < TU_ARRAY_SIZE(uid.id); byte++)
{
uint8_t tmp = uid.id[byte];
for (int digit = 0; digit < 2; digit++)
{
desc_str[chr_count++] = "0123456789ABCDEF"[tmp & 0xf];
tmp >>= 4;
}
}

return chr_count;
}

1 change: 0 additions & 1 deletion bsp/stm32f072disco/unique.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <stdint.h>
#include "tusb.h"


static uint8_t get_unique_id(uint16_t *desc_str)
{
const uint32_t *idpnt = (uint32_t*)(0x1FFFF7AC); /*DEVICE_ID1*/
Expand Down
2 changes: 1 addition & 1 deletion tinyusb
Submodule tinyusb updated 88 files
+25 −4 .github/workflows/build.yml
+48 −4 .github/workflows/trigger.yml
+1 −0 .gitignore
+1 −1 README.md
+70 −0 changelog.md
+22 −8 docs/boards.md
+1 −1 examples/device/audio_test/CMakeLists.txt
+1 −1 examples/device/board_test/CMakeLists.txt
+0 −4 examples/device/board_test/src/main.c
+1 −1 examples/device/cdc_dual_ports/CMakeLists.txt
+1 −1 examples/device/cdc_msc/CMakeLists.txt
+1 −1 examples/device/dfu_runtime/CMakeLists.txt
+0 −0 examples/device/dfu_runtime/Makefile
+1 −1 examples/device/dfu_runtime/src/main.c
+1 −1 examples/device/dfu_runtime/src/tusb_config.h
+0 −0 examples/device/dfu_runtime/src/usb_descriptors.c
+1 −1 examples/device/dynamic_configuration/CMakeLists.txt
+6 −0 examples/device/dynamic_configuration/src/main.c
+1 −1 examples/device/hid_composite/CMakeLists.txt
+107 −33 examples/device/hid_composite/src/main.c
+6 −4 examples/device/hid_composite/src/usb_descriptors.c
+4 −1 examples/device/hid_composite/src/usb_descriptors.h
+106 −31 examples/device/hid_composite_freertos/src/main.c
+6 −4 examples/device/hid_composite_freertos/src/usb_descriptors.c
+4 −1 examples/device/hid_composite_freertos/src/usb_descriptors.h
+1 −1 examples/device/hid_generic_inout/CMakeLists.txt
+2 −2 examples/device/hid_generic_inout/src/main.c
+1 −1 examples/device/hid_multiple_interface/CMakeLists.txt
+6 −6 examples/device/hid_multiple_interface/src/usb_descriptors.c
+1 −1 examples/device/midi_test/CMakeLists.txt
+6 −0 examples/device/midi_test/src/main.c
+1 −1 examples/device/msc_dual_lun/CMakeLists.txt
+1 −1 examples/device/net_lwip_webserver/CMakeLists.txt
+1 −1 examples/device/uac2_headset/CMakeLists.txt
+1 −1 examples/device/usbtmc/CMakeLists.txt
+1 −1 examples/device/webusb_serial/CMakeLists.txt
+45 −43 examples/device/webusb_serial/src/main.c
+6 −1 examples/make.mk
+23 −12 examples/rules.mk
+5 −0 hw/bsp/board.h
+45 −0 hw/bsp/esp32s2/boards/adafruit_feather_esp32s2/board.h
+45 −0 hw/bsp/esp32s2/boards/adafruit_magtag_29gray/board.h
+43 −0 hw/bsp/esp32s2/boards/adafruit_metro_esp32s2/board.h
+15 −1 hw/bsp/esp32s2/boards/esp32s2.c
+4 −1 hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.h
+4 −1 hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.h
+5 −1 hw/bsp/rp2040/boards/adafruit_qt_rp2040/board.h
+4 −1 hw/bsp/rp2040/boards/raspberry_pi_pico/board.h
+51 −3 hw/bsp/rp2040/family.c
+24 −0 hw/bsp/rp2040/family.cmake
+46 −0 hw/bsp/samd11/boards/luna_d11/board.h
+11 −0 hw/bsp/samd11/boards/luna_d11/board.mk
+143 −0 hw/bsp/samd11/boards/luna_d11/samd11d14am_flash.ld
+46 −0 hw/bsp/samd11/boards/samd11_xplained/board.h
+12 −0 hw/bsp/samd11/boards/samd11_xplained/board.mk
+0 −0 hw/bsp/samd11/boards/samd11_xplained/samd11d14am_flash.ld
+4 −6 hw/bsp/samd11/family.c
+4 −11 hw/bsp/samd11/family.mk
+0 −0 hw/bsp/samd21/boards/luna_d21/board.h
+0 −0 hw/bsp/samd21/boards/luna_d21/board.mk
+0 −0 hw/bsp/samd21/boards/luna_d21/samd21g18a_flash.ld
+2 −2 hw/bsp/samd51/boards/feather_m4_express/board.h
+2 −2 hw/bsp/samd51/boards/itsybitsy_m4/board.h
+2 −2 hw/bsp/samd51/boards/metro_m4_express/board.h
+50 −0 hw/bsp/samd51/boards/pybadge/board.h
+8 −0 hw/bsp/samd51/boards/pybadge/board.mk
+166 −0 hw/bsp/samd51/boards/pybadge/pybadge.ld
+50 −0 hw/bsp/samd51/boards/pyportal/board.h
+8 −0 hw/bsp/samd51/boards/pyportal/board.mk
+166 −0 hw/bsp/samd51/boards/pyportal/pyportal.ld
+1 −1 hw/mcu/raspberrypi/pico-sdk
+2 −2 src/class/dfu/dfu_rt_device.c
+1 −1 src/class/dfu/dfu_rt_device.h
+91 −0 src/class/hid/hid.h
+35 −12 src/class/hid/hid_device.c
+37 −16 src/class/hid/hid_device.h
+38 −10 src/class/midi/midi_device.c
+68 −46 src/device/usbd.c
+1 −0 src/device/usbd.h
+4 −14 src/device/usbd_control.c
+2 −0 src/osal/osal.h
+130 −0 src/osal/osal_rtthread.h
+17 −18 src/portable/raspberrypi/rp2040/dcd_rp2040.c
+3 −2 src/portable/raspberrypi/rp2040/hcd_rp2040.c
+5 −1 src/portable/raspberrypi/rp2040/rp2040_usb.c
+1 −1 src/tusb.h
+4 −3 src/tusb_option.h
+2 −1 tools/build_family.py

0 comments on commit 26039d8

Please sign in to comment.