Skip to content

Remove redundant header files in STM port #7024

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

Merged
merged 2 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions ports/stm/common-hal/alarm/pin/PinAlarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#include "py/runtime.h"

#include "shared-bindings/alarm/pin/PinAlarm.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Pin.h"

#include "peripherals/exti.h"

Expand Down
1 change: 0 additions & 1 deletion ports/stm/common-hal/alarm/time/TimeAlarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include "shared-bindings/alarm/time/TimeAlarm.h"
#include "shared-bindings/time/__init__.h"
#include "supervisor/port.h"
#include "peripherals/rtc.h"

#include STM32_HAL_H
Expand Down
3 changes: 3 additions & 0 deletions ports/stm/common-hal/analogio/AnalogOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
#include <stdint.h>
#include <string.h>


#include "py/mperrno.h"
#include "py/runtime.h"



#include "shared-bindings/analogio/AnalogOut.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "supervisor/shared/translate/translate.h"
Expand Down
1 change: 0 additions & 1 deletion ports/stm/common-hal/busio/I2C.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "py/mperrno.h"
#include "py/runtime.h"

#include "shared-bindings/microcontroller/__init__.h"
#include "supervisor/shared/translate/translate.h"
#include "shared-bindings/microcontroller/Pin.h"

Expand Down
3 changes: 0 additions & 3 deletions ports/stm/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@
#include <string.h>

#include "shared-bindings/busio/SPI.h"
#include "py/mperrno.h"
#include "py/runtime.h"

#include "shared-bindings/microcontroller/__init__.h"
#include "supervisor/board.h"
#include "supervisor/shared/translate/translate.h"
#include "shared-bindings/microcontroller/Pin.h"

Expand Down
2 changes: 0 additions & 2 deletions ports/stm/common-hal/digitalio/DigitalInOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

#include "shared-bindings/digitalio/DigitalInOut.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "py/runtime.h"
#include "supervisor/shared/translate/translate.h"

// The HAL is sparse on obtaining register information, so we use the LLs here.
#if (CPY_STM32H7)
Expand Down
2 changes: 0 additions & 2 deletions ports/stm/common-hal/microcontroller/Pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
*/

#include "shared-bindings/microcontroller/Pin.h"
#include "shared-bindings/digitalio/DigitalInOut.h"

#include "py/mphal.h"
#include "pins.h"

#if defined(TFBGA216)
Expand Down
1 change: 0 additions & 1 deletion ports/stm/common-hal/pulseio/PulseIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <stdint.h>
#include <string.h>
#include "py/mpconfig.h"
#include "py/gc.h"
#include "py/runtime.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Pin.h"
Expand Down
4 changes: 0 additions & 4 deletions ports/stm/common-hal/pulseio/PulseOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@
#include <stdint.h>

#include "py/mpconfig.h"
#include "py/gc.h"
#include "py/runtime.h"
#include "shared-bindings/pulseio/PulseOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "supervisor/shared/translate/translate.h"

#include STM32_HAL_H
#include "shared-bindings/microcontroller/Pin.h"
#include "timers.h"

// A single timer is shared amongst all PulseOut objects under the assumption that
Expand Down
1 change: 0 additions & 1 deletion ports/stm/common-hal/pwmio/PWMOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "shared-bindings/pwmio/PWMOut.h"
#include "supervisor/shared/translate/translate.h"

#include "shared-bindings/microcontroller/__init__.h"
#include STM32_HAL_H
#include "shared-bindings/microcontroller/Pin.h"

Expand Down
4 changes: 0 additions & 4 deletions ports/stm/common-hal/rtc/RTC.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@

#include <stdio.h>

#include "py/obj.h"
#include "py/runtime.h"
#include "shared/timeutils/timeutils.h"
#include "shared-bindings/rtc/__init__.h"
#include "common-hal/rtc/RTC.h"
#include "shared-bindings/rtc/RTC.h"
#include "supervisor/port.h"
#include "supervisor/shared/translate/translate.h"
#include "peripherals/rtc.h"

Expand Down
3 changes: 0 additions & 3 deletions ports/stm/mphalport.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@
#include <string.h>

#include "py/mphal.h"
#include "py/mpstate.h"
#include "py/gc.h"

#include "shared-bindings/microcontroller/__init__.h"
#include "supervisor/shared/tick.h"

void mp_hal_delay_us(mp_uint_t delay) {
common_hal_mcu_delay_us(delay);
Expand Down
4 changes: 1 addition & 3 deletions ports/stm/peripherals/exti.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@

#include <stdbool.h>
#include "py/mpconfig.h"
#include "py/gc.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "py/misc.h"

#include "peripherals/exti.h"

Expand Down
3 changes: 0 additions & 3 deletions ports/stm/peripherals/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#include STM32_HAL_H

#include "py/mpconfig.h"
#include "py/gc.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "shared/timeutils/timeutils.h"

// Default period for ticks is 1/1024 second
Expand Down
1 change: 0 additions & 1 deletion ports/stm/peripherals/timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "timers.h"

#include "py/mpconfig.h"
#include "py/gc.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "supervisor/shared/translate/translate.h"
Expand Down
5 changes: 0 additions & 5 deletions ports/stm/supervisor/internal_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@
#include <stdint.h>
#include <string.h>

#include "extmod/vfs.h"
#include "extmod/vfs_fat.h"
#include "py/mphal.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "lib/oofatfs/ff.h"
#include "supervisor/flash.h"
#include "supervisor/shared/safe_mode.h"

Expand Down
1 change: 0 additions & 1 deletion ports/stm/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "supervisor/background_callback.h"
#include "supervisor/board.h"
#include "supervisor/port.h"
#include "shared/timeutils/timeutils.h"

#include "common-hal/microcontroller/Pin.h"
#include "shared-bindings/microcontroller/__init__.h"
Expand Down
2 changes: 0 additions & 2 deletions ports/stm/supervisor/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@


#include "supervisor/usb.h"
#include "shared/runtime/interrupt_char.h"
#include "shared/readline/readline.h"
#include "lib/tinyusb/src/device/usbd.h"

#include "py/mpconfig.h"

Expand Down