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