forked from arduino/ArduinoCore-mbed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.h
52 lines (39 loc) · 1.77 KB
/
macros.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
macros.h - basic porting layer for mbed-enabled boards
Part of Arduino - http://www.arduino.cc/
Copyright (c) 2018-2019 Arduino SA
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
#pragma once
#ifdef USE_ARDUINO_PINOUT
#include <Arduino.h>
#include <PinNames.h>
// this is needed for backwards compatibility
#define digitalPinToInterrupt(P) (P)
#else
#define analogPinToPinName(P) ((PinName)P)
#define digitalPinToPinName(P) ((PinName)P)
#define digitalPinToInterrupt(P) ((PinName)P)
#endif
#ifdef __cplusplus
#include <platform/FileHandle.h>
#define REDIRECT_STDOUT_TO(stream) namespace mbed { \
FileHandle *mbed_override_console(int fd) { \
return static_cast<mbed::FileHandle*>(stream); \
} \
FileHandle *mbed_target_override_console(int fd) { \
return static_cast<mbed::FileHandle*>(stream); \
} \
}
#endif //__cplusplus