Skip to content

Commit dd3e773

Browse files
authored
Merge pull request #121 from fpistm/Cleaned_include
Fixed included headers
2 parents 625fe2d + 90d3863 commit dd3e773

File tree

17 files changed

+60
-57
lines changed

17 files changed

+60
-57
lines changed

cores/arduino/WInterrupts.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include "WInterrupts.h"
20+
#include "Arduino.h"
2021

2122
#ifdef __cplusplus
2223
extern "C" {

cores/arduino/WInterrupts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef _WIRING_INTERRUPTS_
2020
#define _WIRING_INTERRUPTS_
2121

22-
#include "Arduino.h"
22+
#include <stdint.h>
2323

2424
#ifdef __cplusplus
2525
extern "C" {

cores/arduino/board.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,6 @@
2121
#include "usb_interface.h"
2222
#endif //USBCON
2323

24-
/* Define attribute */
25-
#if defined ( __GNUC__ ) /* GCC CS3 */
26-
#define WEAK __attribute__ ((weak))
27-
#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */
28-
#define WEAK __weak
29-
#endif
30-
31-
/* Define NO_INIT attribute */
32-
#if defined ( __GNUC__ )
33-
#define NO_INIT
34-
#elif defined ( __ICCARM__ )
35-
#define NO_INIT __no_init
36-
#endif
37-
3824
void init( void ) ;
3925

4026
#endif /* _BOARD_H_ */

cores/arduino/pins_arduino.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#ifndef _PINS_ARDUINO_H_
1919
#define _PINS_ARDUINO_H_
2020

21-
// API compatibility
21+
#include "PeripheralPins.h"
22+
#include "pins_arduino_common.h"
2223
#include "variant.h"
2324

2425
#ifdef __cplusplus
@@ -29,7 +30,8 @@ extern "C" {
2930
* Libc porting layers
3031
*/
3132
#if defined ( __GNUC__ ) /* GCC CS3 */
32-
# include <syscalls.h> /** RedHat Newlib minimal stub */
33+
#include <syscalls.h> /** RedHat Newlib minimal stub */
34+
#define WEAK __attribute__ ((weak))
3335
#endif
3436

3537
#define NOT_AN_INTERRUPT NC // -1

cores/arduino/pins_arduino_common.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Common pins Arduino definition
3+
*
4+
* Copyright (C) 2017, STMicroelectronics - All Rights Reserved
5+
* Author: Frederic Pillon for STMicroelectronics.
6+
*
7+
* License type: GPLv2
8+
*
9+
* This program is free software; you can redistribute it and/or modify it
10+
* under the terms of the GNU General Public License version 2 as published by
11+
* the Free Software Foundation.
12+
*
13+
* This program is distributed in the hope that it will be useful, but
14+
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15+
* or FITNESS FOR A PARTICULAR PURPOSE.
16+
* See the GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License along with
19+
* this program. If not, see
20+
* <http://www.gnu.org/licenses/>.
21+
*/
22+
#ifndef _PINS_ARDUINO_COMMON_H_
23+
#define _PINS_ARDUINO_COMMON_H_
24+
25+
// Arduino digital pin alias
26+
// GPIO port (A to K) * 16 pins: 176
27+
enum {
28+
D0, D1, D2, D3, D4, D5, D6, D7, D8, D9,
29+
D10, D11, D12, D13, D14, D15, D16, D17, D18, D19,
30+
D20, D21, D22, D23, D24, D25, D26, D27, D28, D29,
31+
D30, D31, D32, D33, D34, D35, D36, D37, D38, D39,
32+
D40, D41, D42, D43, D44, D45, D46, D47, D48, D49,
33+
D50, D51, D52, D53, D54, D55, D56, D57, D58, D59,
34+
D60, D61, D62, D63, D64, D65, D66, D67, D68, D69,
35+
D70, D71, D72, D73, D74, D75, D76, D77, D78, D79,
36+
D80, D81, D82, D83, D84, D85, D86, D87, D88, D89,
37+
D90, D91, D92, D93, D94, D95, D96, D97, D98, D99,
38+
D100, D101, D102, D103, D104, D105, D106, D107, D108, D109,
39+
D110, D111, D112, D113, D114, D115, D116, D117, D118, D119,
40+
D120, D121, D122, D123, D124, D125, D126, D127, D128, D129,
41+
D130, D131, D132, D133, D134, D135, D136, D137, D138, D139,
42+
D140, D141, D142, D143, D144, D145, D146, D147, D148, D149,
43+
D150, D151, D152, D153, D154, D155, D156, D157, D158, D159,
44+
D160, D161, D162, D163, D164, D165, D166, D167, D168, D169,
45+
D170, D171, D172, D173, D174, D175,
46+
DMAX
47+
};
48+
49+
#endif /*_PINS_ARDUINO_COMMON_H_*/
50+

cores/arduino/stm32/analog.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
* @{
4848
*/
4949
#include "stm32_def.h"
50-
#include "hw_config.h"
5150
#include "analog.h"
5251
#include "timer.h"
5352
#include "PinAF_STM32F1.h"

cores/arduino/stm32/clock.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
* @{
4848
*/
4949
#include "stm32_def.h"
50-
#include "hw_config.h"
5150

5251
#ifdef __cplusplus
5352
extern "C" {

cores/arduino/stm32/interrupt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
* @{
4848
*/
4949
#include "stm32_def.h"
50-
#include "hw_config.h"
5150
#include "interrupt.h"
5251

5352
#ifdef __cplusplus

cores/arduino/stm32/spi_com.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
* @{
4848
*/
4949
#include "stm32_def.h"
50-
#include "hw_config.h"
5150
#include "spi_com.h"
5251
#include "PinAF_STM32F1.h"
5352

cores/arduino/stm32/timer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
* @{
4848
*/
4949
#include "stm32_def.h"
50-
#include "hw_config.h"
5150
#include "timer.h"
5251
#include "digital_io.h"
5352
#include "clock.h"

cores/arduino/stm32/twi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
* @{
4949
*/
5050
#include "stm32_def.h"
51-
#include "hw_config.h"
5251
#include "twi.h"
5352
#include "PinAF_STM32F1.h"
5453

cores/arduino/stm32/uart.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@
4646
/** @addtogroup STM32F4xx_System_Private_Includes
4747
* @{
4848
*/
49-
#include "hw_config.h"
5049
#include "uart.h"
51-
#include "digital_io.h"
52-
#include "interrupt.h"
53-
#include "variant.h"
50+
#include "Arduino.h"
5451
#include "PinAF_STM32F1.h"
5552

5653
#ifdef __cplusplus

cores/arduino/stm32/uart_emul.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@
4646
/** @addtogroup STM32F4xx_System_Private_Includes
4747
* @{
4848
*/
49-
#include "hw_config.h"
5049
#include "uart_emul.h"
5150
#include "digital_io.h"
5251
#include "interrupt.h"
53-
#include "variant.h"
52+
#include "Arduino.h"
5453

5554
#if defined(TIM1_BASE) && defined(UART_EMUL_RX) && defined(UART_EMUL_TX)
5655
#ifdef __cplusplus

cores/arduino/wiring.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,4 @@ extern "C"{
5757
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (SystemCoreClock / 1000L) )
5858
#define microsecondsToClockCycles(a) ( (a) * (SystemCoreClock / 1000000L) )
5959

60-
61-
6260
#endif /* _WIRING_H_ */

cores/arduino/wiring_constants.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,6 @@ extern "C"{
2525

2626
#include <stdbool.h>
2727

28-
// Arduino digital pin alias
29-
// GPIO port (A to K) * 16 pins: 176
30-
enum {
31-
D0, D1, D2, D3, D4, D5, D6, D7, D8, D9,
32-
D10, D11, D12, D13, D14, D15, D16, D17, D18, D19,
33-
D20, D21, D22, D23, D24, D25, D26, D27, D28, D29,
34-
D30, D31, D32, D33, D34, D35, D36, D37, D38, D39,
35-
D40, D41, D42, D43, D44, D45, D46, D47, D48, D49,
36-
D50, D51, D52, D53, D54, D55, D56, D57, D58, D59,
37-
D60, D61, D62, D63, D64, D65, D66, D67, D68, D69,
38-
D70, D71, D72, D73, D74, D75, D76, D77, D78, D79,
39-
D80, D81, D82, D83, D84, D85, D86, D87, D88, D89,
40-
D90, D91, D92, D93, D94, D95, D96, D97, D98, D99,
41-
D100, D101, D102, D103, D104, D105, D106, D107, D108, D109,
42-
D110, D111, D112, D113, D114, D115, D116, D117, D118, D119,
43-
D120, D121, D122, D123, D124, D125, D126, D127, D128, D129,
44-
D130, D131, D132, D133, D134, D135, D136, D137, D138, D139,
45-
D140, D141, D142, D143, D144, D145, D146, D147, D148, D149,
46-
D150, D151, D152, D153, D154, D155, D156, D157, D158, D159,
47-
D160, D161, D162, D163, D164, D165, D166, D167, D168, D169,
48-
D170, D171, D172, D173, D174, D175,
49-
DEND
50-
};
51-
5228
#define HIGH 0x1
5329
#define LOW 0x0
5430

libraries/SPI/src/SPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef _SPI_H_INCLUDED
1313
#define _SPI_H_INCLUDED
1414

15-
#include "variant.h"
15+
#include "Arduino.h"
1616
#include <stdio.h>
1717

1818
// SPI_HAS_TRANSACTION means SPI has

libraries/Wire/Wire.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include <inttypes.h>
2626
#include "Stream.h"
27-
#include "variant.h"
27+
#include "Arduino.h"
2828

2929
#define BUFFER_LENGTH 32
3030

0 commit comments

Comments
 (0)