mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Ifdef include requested change
This commit is contained in:
parent
02565a0ba3
commit
76762571ea
@ -1,7 +1,9 @@
|
|||||||
#ifdef __SAMD51__
|
|
||||||
#include <Arduino.h>
|
|
||||||
#include "samd51_platform.h"
|
#include "samd51_platform.h"
|
||||||
|
|
||||||
|
#ifdef __SAMD51__
|
||||||
|
|
||||||
#include <knx/bits.h>
|
#include <knx/bits.h>
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
#if KNX_FLASH_SIZE % 1024
|
#if KNX_FLASH_SIZE % 1024
|
||||||
#error "KNX_FLASH_SIZE must be multiple of 1024"
|
#error "KNX_FLASH_SIZE must be multiple of 1024"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#ifdef __SAMD51__
|
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#include "arduino_platform.h"
|
#include "arduino_platform.h"
|
||||||
|
|
||||||
|
#ifdef __SAMD51__
|
||||||
|
|
||||||
class Samd51Platform : public ArduinoPlatform
|
class Samd51Platform : public ArduinoPlatform
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
|
#include "samd_platform.h"
|
||||||
|
|
||||||
#if(defined(__SAMD21E17A__) || \
|
#if(defined(__SAMD21E17A__) || \
|
||||||
defined(__SAMD21G18A__) || \
|
defined(__SAMD21G18A__) || \
|
||||||
defined(__SAMD21E18A__) || \
|
defined(__SAMD21E18A__) || \
|
||||||
defined(__SAMD21J18A__))
|
defined(__SAMD21J18A__))
|
||||||
|
|
||||||
#include "samd_platform.h"
|
|
||||||
|
|
||||||
#include <knx/bits.h>
|
#include <knx/bits.h>
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
@ -39,21 +39,11 @@ SamdPlatform::SamdPlatform( HardwareSerial* s) : ArduinoPlatform(s)
|
|||||||
|
|
||||||
uint32_t SamdPlatform::uniqueSerialNumber()
|
uint32_t SamdPlatform::uniqueSerialNumber()
|
||||||
{
|
{
|
||||||
#if defined (__SAMD51__)
|
#define SERIAL_NUMBER_WORD_0 *(volatile uint32_t*)(0x0080A00C)
|
||||||
// SAMD51 from section 9.6 of the datasheet
|
#define SERIAL_NUMBER_WORD_1 *(volatile uint32_t*)(0x0080A040)
|
||||||
#define SERIAL_NUMBER_WORD_0 *(volatile uint32_t*)(0x008061FC)
|
#define SERIAL_NUMBER_WORD_2 *(volatile uint32_t*)(0x0080A044)
|
||||||
#define SERIAL_NUMBER_WORD_1 *(volatile uint32_t*)(0x00806010)
|
#define SERIAL_NUMBER_WORD_3 *(volatile uint32_t*)(0x0080A048)
|
||||||
#define SERIAL_NUMBER_WORD_2 *(volatile uint32_t*)(0x00806014)
|
|
||||||
#define SERIAL_NUMBER_WORD_3 *(volatile uint32_t*)(0x00806018)
|
|
||||||
#else
|
|
||||||
//#elif defined (__SAMD21E17A__) || defined(__SAMD21G18A__) || defined(__SAMD21E18A__) || defined(__SAMD21J18A__)
|
|
||||||
// SAMD21 from section 9.3.3 of the datasheet
|
|
||||||
#define SERIAL_NUMBER_WORD_0 *(volatile uint32_t*)(0x0080A00C)
|
|
||||||
#define SERIAL_NUMBER_WORD_1 *(volatile uint32_t*)(0x0080A040)
|
|
||||||
#define SERIAL_NUMBER_WORD_2 *(volatile uint32_t*)(0x0080A044)
|
|
||||||
#define SERIAL_NUMBER_WORD_3 *(volatile uint32_t*)(0x0080A048)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return SERIAL_NUMBER_WORD_0 ^ SERIAL_NUMBER_WORD_1 ^ SERIAL_NUMBER_WORD_2 ^ SERIAL_NUMBER_WORD_3;
|
return SERIAL_NUMBER_WORD_0 ^ SERIAL_NUMBER_WORD_1 ^ SERIAL_NUMBER_WORD_2 ^ SERIAL_NUMBER_WORD_3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user