Commit 7da8ba75 authored by Sandeep Mistry's avatar Sandeep Mistry

Add conditional updates to new MDK files + update to new NRFxx_SERIES defines

parent 8882b99d
...@@ -43,7 +43,9 @@ NRF_MDK_VERSION_ASSERT_AT_LEAST(8,34,0); ...@@ -43,7 +43,9 @@ NRF_MDK_VERSION_ASSERT_AT_LEAST(8,34,0);
#include "nrf51_erratas.h" #include "nrf51_erratas.h"
#include "nrf52_erratas.h" #include "nrf52_erratas.h"
#include "nrf53_erratas.h" #include "nrf53_erratas.h"
#ifndef ARDUINO
#include "nrf91_erratas.h" #include "nrf91_erratas.h"
#endif
/*lint --flb "Leave library region" */ /*lint --flb "Leave library region" */
......
#if defined(ARDUINO) && defined(NRF51)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -298,3 +299,4 @@ Default_Handler: ...@@ -298,3 +299,4 @@ Default_Handler:
IRQ SWI5_IRQHandler IRQ SWI5_IRQHandler
.end .end
#endif
#if defined(ARDUINO) && defined(NRF52)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -404,3 +405,4 @@ Default_Handler: ...@@ -404,3 +405,4 @@ Default_Handler:
IRQ FPU_IRQHandler IRQ FPU_IRQHandler
.end .end
#endif
#if defined(ARDUINO) && defined(NRF52805_XXAA)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -391,3 +392,4 @@ Default_Handler: ...@@ -391,3 +392,4 @@ Default_Handler:
IRQ SWI5_IRQHandler IRQ SWI5_IRQHandler
.end .end
#endif
#if defined(ARDUINO) && defined(NRF52810_XXAA)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -417,3 +418,4 @@ Default_Handler: ...@@ -417,3 +418,4 @@ Default_Handler:
IRQ PDM_IRQHandler IRQ PDM_IRQHandler
.end .end
#endif
#if defined(ARDUINO) && defined(NRF52811_XXAA)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -394,3 +395,4 @@ Default_Handler: ...@@ -394,3 +395,4 @@ Default_Handler:
IRQ PDM_IRQHandler IRQ PDM_IRQHandler
.end .end
#endif
#if defined(ARDUINO) && defined(NRF52820_XXAA)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -393,3 +394,4 @@ Default_Handler: ...@@ -393,3 +394,4 @@ Default_Handler:
IRQ USBD_IRQHandler IRQ USBD_IRQHandler
.end .end
#endif
#if defined(ARDUINO) && defined(NRF52833_XXAA)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -408,3 +409,4 @@ Default_Handler: ...@@ -408,3 +409,4 @@ Default_Handler:
IRQ SPIM3_IRQHandler IRQ SPIM3_IRQHandler
.end .end
#endif
#if defined(ARDUINO) && defined(NRF52840_XXAA)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -410,3 +411,4 @@ Default_Handler: ...@@ -410,3 +411,4 @@ Default_Handler:
IRQ SPIM3_IRQHandler IRQ SPIM3_IRQHandler
.end .end
#endif
#if defined(ARDUINO) && defined(NRF5340_XXAA) && defined(NRF_APPLICATION)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -543,3 +544,4 @@ Default_Handler: ...@@ -543,3 +544,4 @@ Default_Handler:
IRQ CRYPTOCELL_IRQHandler IRQ CRYPTOCELL_IRQHandler
.end .end
#endif
#if defined(ARDUINO) && defined(NRF5340_XXAA) && defined(NRF_NETWORK)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -404,3 +405,4 @@ Default_Handler: ...@@ -404,3 +405,4 @@ Default_Handler:
IRQ SWI3_IRQHandler IRQ SWI3_IRQHandler
.end .end
#endif
...@@ -27,6 +27,7 @@ NOTICE: This file has been modified by Nordic Semiconductor ASA. ...@@ -27,6 +27,7 @@ NOTICE: This file has been modified by Nordic Semiconductor ASA.
#include <stdbool.h> #include <stdbool.h>
#include "nrf.h" #include "nrf.h"
#include "nrf_erratas.h" #include "nrf_erratas.h"
#if defined(ARDUINO) && defined(NRF51_SERIES)
#include "system_nrf51.h" #include "system_nrf51.h"
/*lint ++flb "Enter library region" */ /*lint ++flb "Enter library region" */
...@@ -87,3 +88,4 @@ void SystemInit(void) ...@@ -87,3 +88,4 @@ void SystemInit(void)
} }
/*lint --flb "Leave library region" */ /*lint --flb "Leave library region" */
#endif
...@@ -28,6 +28,7 @@ NOTICE: This file has been modified by Nordic Semiconductor ASA. ...@@ -28,6 +28,7 @@ NOTICE: This file has been modified by Nordic Semiconductor ASA.
#include "nrf.h" #include "nrf.h"
#include "nrf_peripherals.h" #include "nrf_peripherals.h"
#include "nrf_erratas.h" #include "nrf_erratas.h"
#if defined(ARDUINO) && defined(NRF52_SERIES)
#include "system_nrf52.h" #include "system_nrf52.h"
#define __SYSTEM_CLOCK_64M (64000000UL) #define __SYSTEM_CLOCK_64M (64000000UL)
...@@ -314,3 +315,4 @@ void SystemInit(void) ...@@ -314,3 +315,4 @@ void SystemInit(void)
SystemCoreClockUpdate(); SystemCoreClockUpdate();
} }
#endif
...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef ARDUINO
#include "system_nrf52.c" #include "system_nrf52.c"
#endif
...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef ARDUINO
#include "system_nrf52.c" #include "system_nrf52.c"
#endif
...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef ARDUINO
#include "system_nrf52.c" #include "system_nrf52.c"
#endif
...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef ARDUINO
#include "system_nrf52.c" #include "system_nrf52.c"
#endif
...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef ARDUINO
#include "system_nrf52.c" #include "system_nrf52.c"
#endif
...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -30,4 +30,6 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef ARDUINO
#include "system_nrf52.c" #include "system_nrf52.c"
#endif
#if defined(ARDUINO) && defined(NRF5340_XXAA) && defined(NRF_APPLICATION)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -248,3 +249,4 @@ void SystemInit(void) ...@@ -248,3 +249,4 @@ void SystemInit(void)
} }
/*lint --flb "Leave library region" */ /*lint --flb "Leave library region" */
#endif
#if defined(ARDUINO) && defined(NRF5340_XXAA) && defined(NRF_NETWORK)
/* /*
Copyright (c) 2009-2020 ARM Limited. All rights reserved. Copyright (c) 2009-2020 ARM Limited. All rights reserved.
...@@ -91,3 +92,4 @@ void SystemInit(void) ...@@ -91,3 +92,4 @@ void SystemInit(void)
} }
/*lint --flb "Leave library region" */ /*lint --flb "Leave library region" */
#endif
...@@ -225,9 +225,9 @@ size_t Uart::write(const uint8_t data) ...@@ -225,9 +225,9 @@ size_t Uart::write(const uint8_t data)
return 1; return 1;
} }
#if defined(NRF52) #if defined(NRF52_SERIES)
#define NRF_UART0_IRQn UARTE0_UART0_IRQn #define NRF_UART0_IRQn UARTE0_UART0_IRQn
#elif defined(NRF51) #elif defined(NRF51_SERIES)
#define NRF_UART0_IRQn UART0_IRQn #define NRF_UART0_IRQn UART0_IRQn
#endif #endif
...@@ -237,7 +237,7 @@ size_t Uart::write(const uint8_t data) ...@@ -237,7 +237,7 @@ size_t Uart::write(const uint8_t data)
Uart Serial( NRF_UART0, NRF_UART0_IRQn, PIN_SERIAL_RX, PIN_SERIAL_TX ); Uart Serial( NRF_UART0, NRF_UART0_IRQn, PIN_SERIAL_RX, PIN_SERIAL_TX );
#endif #endif
#if defined(NRF52) #if defined(NRF52_SERIES)
extern "C" extern "C"
{ {
void UARTE0_UART0_IRQHandler() void UARTE0_UART0_IRQHandler()
...@@ -245,7 +245,7 @@ extern "C" ...@@ -245,7 +245,7 @@ extern "C"
Serial.IrqHandler(); Serial.IrqHandler();
} }
} }
#elif defined(NRF51) #elif defined(NRF51_SERIES)
extern "C" extern "C"
{ {
void UART0_IRQHandler() void UART0_IRQHandler()
......
...@@ -25,10 +25,12 @@ ...@@ -25,10 +25,12 @@
extern "C" { extern "C" {
#endif #endif
#include "nrf.h"
/* /*
* \brief nRF51 and nRF52 have different reference options. * \brief nRF51 and nRF52 have different reference options.
*/ */
#ifdef NRF52 #if defined(NRF52_SERIES)
typedef enum _eAnalogReference typedef enum _eAnalogReference
{ {
AR_DEFAULT, AR_DEFAULT,
......
...@@ -17,13 +17,11 @@ ...@@ -17,13 +17,11 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef NRF51
#include "nrf.h"
#include "Arduino.h" #include "Arduino.h"
#include "wiring_private.h" #include "wiring_private.h"
#if defined(NRF51_SERIES)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
......
...@@ -17,13 +17,11 @@ ...@@ -17,13 +17,11 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef NRF52
#include "nrf.h"
#include "Arduino.h" #include "Arduino.h"
#include "wiring_private.h" #include "wiring_private.h"
#if defined(NRF52_SERIES)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
class TwoWire : public Stream class TwoWire : public Stream
{ {
public: public:
#ifdef NRF52 #if defined(NRF52_SERIES)
TwoWire(NRF_TWIM_Type * p_twim, NRF_TWIS_Type * p_twis, IRQn_Type IRQn, uint8_t pinSDA, uint8_t pinSCL); TwoWire(NRF_TWIM_Type * p_twim, NRF_TWIS_Type * p_twis, IRQn_Type IRQn, uint8_t pinSDA, uint8_t pinSCL);
#else #else
TwoWire(NRF_TWI_Type * p_twi, uint8_t pinSDA, uint8_t pinSCL); TwoWire(NRF_TWI_Type * p_twi, uint8_t pinSDA, uint8_t pinSCL);
...@@ -43,7 +43,7 @@ class TwoWire : public Stream ...@@ -43,7 +43,7 @@ class TwoWire : public Stream
void setPins(uint8_t pinSDA, uint8_t pinSCL); void setPins(uint8_t pinSDA, uint8_t pinSCL);
#endif // ARDUINO_GENERIC #endif // ARDUINO_GENERIC
void begin(); void begin();
#ifdef NRF52 #if defined(NRF52_SERIES)
void begin(uint8_t); void begin(uint8_t);
#endif #endif
void end(); void end();
...@@ -63,7 +63,7 @@ class TwoWire : public Stream ...@@ -63,7 +63,7 @@ class TwoWire : public Stream
virtual int read(void); virtual int read(void);
virtual int peek(void); virtual int peek(void);
virtual void flush(void); virtual void flush(void);
#ifdef NRF52 #if defined(NRF52_SERIES)
void onReceive(void(*)(int)); void onReceive(void(*)(int));
void onRequest(void(*)(void)); void onRequest(void(*)(void));
void onService(void); void onService(void);
...@@ -72,7 +72,7 @@ class TwoWire : public Stream ...@@ -72,7 +72,7 @@ class TwoWire : public Stream
using Print::write; using Print::write;
private: private:
#ifdef NRF52 #if defined(NRF52_SERIES)
NRF_TWIM_Type * _p_twim; NRF_TWIM_Type * _p_twim;
NRF_TWIS_Type * _p_twis; NRF_TWIS_Type * _p_twis;
#else #else
......
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef NRF51 #include "nrf.h"
#if defined(NRF51_SERIES)
extern "C" { extern "C" {
#include <string.h> #include <string.h>
......
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifdef NRF52 #include "nrf.h"
#if defined(NRF52_SERIES)
extern "C" { extern "C" {
#include <string.h> #include <string.h>
......
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
#ifndef _VARIANT_GENERIC_ #ifndef _VARIANT_GENERIC_
#define _VARIANT_GENERIC_ #define _VARIANT_GENERIC_
#include "nrf.h"
/** Master clock frequency */ /** Master clock frequency */
#ifdef NRF52 #if defined(NRF52_SERIES)
#define VARIANT_MCK (64000000ul) #define VARIANT_MCK (64000000ul)
#else #else
#define VARIANT_MCK (16000000ul) #define VARIANT_MCK (16000000ul)
...@@ -61,7 +63,7 @@ static const uint8_t A2 = PIN_A2 ; ...@@ -61,7 +63,7 @@ static const uint8_t A2 = PIN_A2 ;
static const uint8_t A3 = PIN_A3 ; static const uint8_t A3 = PIN_A3 ;
static const uint8_t A4 = PIN_A4 ; static const uint8_t A4 = PIN_A4 ;
static const uint8_t A5 = PIN_A5 ; static const uint8_t A5 = PIN_A5 ;
#ifdef NRF52 #if defined(NRF52_SERIES)
#define ADC_RESOLUTION 14 #define ADC_RESOLUTION 14
#else #else
#define ADC_RESOLUTION 10 #define ADC_RESOLUTION 10
......
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
#ifndef _VARIANT_GENERIC_ #ifndef _VARIANT_GENERIC_
#define _VARIANT_GENERIC_ #define _VARIANT_GENERIC_
#include "nrf.h"
/** Master clock frequency */ /** Master clock frequency */
#ifdef NRF52 #if defined(NRF52_SERIES)
#define VARIANT_MCK (64000000ul) #define VARIANT_MCK (64000000ul)
#else #else
#define VARIANT_MCK (16000000ul) #define VARIANT_MCK (16000000ul)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment