Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Commit 8cfdd39

Browse files
committed
Add ARDUINO_ARCH_XXX to allow meaningful architecture guards
1 parent 8a79f9c commit 8cfdd39

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

libraries/PDM/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ sentence=Enables the communication with devices that use the PDM Bus. Specific i
66
paragraph=
77
category=Communication
88
url=
9-
architectures=nRF52
9+
architectures=mbed

libraries/PDM/src/PDM.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#include <hal/nrf_pdm.h>
2-
31
#include "PDM.h"
2+
#include <hal/nrf_pdm.h>
43

54
#define DEFAULT_PDM_GAIN 20
65
#define PDM_IRQ_PRIORITY 7

libraries/PDM/src/PDM.h

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
#include <Arduino.h>
55

6+
#ifndef ARDUINO_ARCH_NRF52840
7+
#error "This library targets only NRF52840 boards, not every mbed target"
8+
#endif
9+
610
#include "utility/PDMDoubleBuffer.h"
711

812
class PDMClass

platform.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ compiler.warning_flags.all=-Wall -Wextra
1818

1919
compiler.path={build.compiler_path}
2020
compiler.c.cmd={build.crossprefix}gcc
21-
compiler.c.flags=-c -I. {compiler.warning_flags} -Os -g -nostdlib "@{compiler.mbed.defines}" "@{compiler.mbed.cflags}" -MMD -mcpu={build.mcu}
21+
compiler.c.flags=-c -I. {compiler.warning_flags} -Os -g -nostdlib "@{compiler.mbed.defines}" "@{compiler.mbed.cflags}" {compiler.mbed.arch.define} -MMD -mcpu={build.mcu}
2222
compiler.c.elf.cmd={build.crossprefix}g++
2323
compiler.c.elf.flags=-Wl,--gc-sections {compiler.warning_flags} -Wl,--as-needed
2424
compiler.S.flags=-c -g -x assembler-with-cpp -Os -mcpu={build.mcu}
2525
compiler.cpp.cmd={build.crossprefix}g++
26-
compiler.cpp.flags=-c -I. {compiler.warning_flags} -g -Os -nostdlib "@{compiler.mbed.defines}" "@{compiler.mbed.cxxflags}" -MMD -mcpu={build.mcu}
26+
compiler.cpp.flags=-c -I. {compiler.warning_flags} -g -Os -nostdlib "@{compiler.mbed.defines}" "@{compiler.mbed.cxxflags}" {compiler.mbed.arch.define} -MMD -mcpu={build.mcu}
2727
compiler.ar.cmd={build.crossprefix}ar
2828
compiler.ar.flags=rcs
2929
compiler.objcopy.cmd=

0 commit comments

Comments
 (0)