Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added macro NRF52_SERIES when checking for _delay_us to work with NRF52840 #208

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 39 additions & 38 deletions src/SPIMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,43 +64,43 @@
// platforms (In ALPHA) //
// //
// Change the ZERO_SPISERCOM define below to use other SPI ports //
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// #define ENABLEZERODMA //
// #define ZERO_SPISERCOM SERCOM4 //
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

# include <Arduino.h>
# include <SPI.h>
# include "defines.h"
# include "SPIFlash.h"
# include "SPIFram.h"
# include "diagnostics.h"

# if defined(ARDUINO_ARCH_SAM)
# include <malloc.h>
# include <stdlib.h>
# include <stdio.h>
# include "DMASAM.h"
# endif

# if defined(ARDUINO_ARCH_SAMD)
# if defined(ENABLEZERODMA)
# include "DMASAMD.h"
# endif
# endif

# if defined(BOARD_RTL8195A)
# ifdef __cplusplus
extern "C" {
# endif

# include "gpio_api.h"
# include "PinNames.h"

# ifdef __cplusplus
}
# endif
# endif /* if defined(BOARD_RTL8195A) */
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//#define ENABLEZERODMA //
//#define ZERO_SPISERCOM SERCOM4 //
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

#include <Arduino.h>
#include <SPI.h>
#include "defines.h"
#include "SPIFlash.h"
#include "SPIFram.h"
#include "diagnostics.h"

#if defined (ARDUINO_ARCH_SAM)
#include <malloc.h>
#include <stdlib.h>
#include <stdio.h>
#include "DMASAM.h"
#endif

#if defined (ARDUINO_ARCH_SAMD)
#if defined (ENABLEZERODMA)
#include "DMASAMD.h"
#endif
#endif

#if defined (BOARD_RTL8195A)
#ifdef __cplusplus
extern "C" {
#endif

#include "gpio_api.h"
#include "PinNames.h"

#ifdef __cplusplus
}
#endif
#endif

# ifndef ARCH_STM32
# if defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32L0) || defined(__STM32F1__) || defined(STM32F1) || \
Expand All @@ -109,7 +109,8 @@ extern "C" {
# endif
# endif
# if defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_ESP8266) || defined(SIMBLEE) || \
defined(ARDUINO_ARCH_ESP32) || defined(BOARD_RTL8195A) || defined(ARCH_STM32) || defined(ESP32) || defined(NRF52)
defined(ARDUINO_ARCH_ESP32) || defined(BOARD_RTL8195A) || defined(ARCH_STM32) || defined(ESP32) || defined(NRF52) || defined(NRF52_SERIES)

// RTL8195A included - @boseji <salearj@hotmail.com> 02.03.17
# define _delay_us(us) delayMicroseconds(us)
# else
Expand Down