Skip to content

Commit

Permalink
Merge pull request #18 from khoih-prog/master
Browse files Browse the repository at this point in the history
Add support to arduino-pico core
  • Loading branch information
ricaun authored Sep 13, 2022
2 parents cba8452 + 0e2ffbd commit 483f5bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ sentence=Arduino Library to gets the Manufacture Serial Number from the Atmel AV
paragraph=The ArduinoUniqueID Library use the buildin feature to select the manufacture serial number from the microcontroler. Suported microcontroler: Atmega328pb, Atmega328p, Atmega2560, Attiny85, SAM3X8E, SAMD21, STM32, ESP8266 & ESP32.
category=Other
url=https://github.com/ricaun/ArduinoUniqueID
architectures=avr, esp8266, esp32, sam, samd, stm32
architectures=avr, esp8266, esp32, sam, samd, stm32, rp2040, mbed_rp2040, mbed_nano, teensy
includes=ArduinoUniqueID.h
5 changes: 3 additions & 2 deletions src/ArduinoUniqueID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ ArduinoUniqueID::ArduinoUniqueID()
id[14] = mac[4];
id[15] = mac[5];

#elif defined(ARDUINO_ARCH_MBED_RP2040)
getUniqueSerialNumber(id);

#elif defined(ARDUINO_ARCH_RP2040)
flash_get_unique_id((uint8_t*) id);

#elif defined(ARDUINO_ARCH_MEGAAVR)
id[0] = SIGROW.SERNUM0;
Expand Down
14 changes: 9 additions & 5 deletions src/ArduinoUniqueID.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
#elif defined(ARDUINO_ARCH_SAMD)
#elif defined(ARDUINO_ARCH_STM32)
#elif defined(TEENSYDUINO)
#elif defined(ARDUINO_ARCH_MBED_RP2040)
//#include <pico/unique_id.h>

#elif defined(ARDUINO_ARCH_RP2040)
extern "C" {
#include "hardware/flash.h"
#include "pico/bootrom.h"
}
#elif defined(ARDUINO_ARCH_MEGAAVR)
#else
#error "ArduinoUniqueID only works on AVR, SAM, SAMD, STM32, Teensy, RP2040, megaAVR and ESP Architecture"
Expand Down Expand Up @@ -55,9 +59,9 @@
#elif defined(TEENSYDUINO)
#define UniqueIDsize 16
#define UniqueIDbuffer 16
#elif defined(ARDUINO_ARCH_MBED_RP2040)
#define UniqueIDsize 32
#define UniqueIDbuffer 32
#elif defined(ARDUINO_ARCH_RP2040)
#define UniqueIDsize 8
#define UniqueIDbuffer 8
#elif defined(ARDUINO_ARCH_MEGAAVR)
#define UniqueIDsize 10
#define UniqueIDbuffer 10
Expand Down

0 comments on commit 483f5bb

Please sign in to comment.