Browse Source

STM32 non-generic PWM_PIN and USEABLE_HARDWARE_PWM (#12016)

pull/1/head
Scott Lahteine 6 years ago
committed by GitHub
parent
commit
33056046a3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Marlin/src/HAL/HAL_DUE/fastio_Due.h
  2. 5
      Marlin/src/HAL/HAL_STM32/fastio_STM32.h
  3. 6
      Marlin/src/HAL/HAL_STM32F1/fastio_Stm32f1.h
  4. 8
      Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h
  5. 6
      Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h
  6. 5
      buildroot/share/tests/STM32F1_tests

2
Marlin/src/HAL/HAL_DUE/fastio_Due.h

@ -47,7 +47,7 @@
// Due has 12 PWMs assigned to logical pins 2-13.
// 6, 7, 8 & 9 come from the PWM controller. The others come from the timers.
#define USEABLE_HARDWARE_PWM(p) ((2 <= p) && (p <= 13))
#define USEABLE_HARDWARE_PWM(p) WITHIN(p, 2, 13)
#ifndef MASK
#define MASK(PIN) (1 << PIN)

5
Marlin/src/HAL/HAL_STM32/fastio_STM32.h

@ -29,8 +29,6 @@
#define _BV(b) (1 << (b))
#define USEABLE_HARDWARE_PWM(p) true
#define READ(IO) digitalRead(IO)
#define WRITE(IO,V) digitalWrite(IO,V)
#define WRITE_VAR(IO,V) WRITE(IO,V)
@ -51,3 +49,6 @@
#define GET_INPUT(IO)
#define GET_OUTPUT(IO)
#define GET_TIMER(IO)
#define PWM_PIN(p) true
#define USEABLE_HARDWARE_PWM(p) PWM_PIN(p)

6
Marlin/src/HAL/HAL_STM32F1/fastio_Stm32f1.h

@ -50,9 +50,7 @@
#define GET_OUTPUT(IO) (_GET_MODE(IO) == GPIO_OUTPUT_PP)
#define GET_TIMER(IO) (PIN_MAP[IO].timer_device != NULL)
/**
* TODO: Write a macro to test if PIN is PWM or not.
*/
#define PWM_PIN(p) true
#define PWM_PIN(p) digitalPinHasPWM(p)
#define USEABLE_HARDWARE_PWM(p) PWM_PIN(p)
#endif // _FASTIO_STM32F1_H

8
Marlin/src/HAL/HAL_STM32F4/fastio_STM32F4.h

@ -32,8 +32,6 @@
#undef _BV
#define _BV(b) (1 << (b))
#define USEABLE_HARDWARE_PWM(p) true
#define READ(IO) digitalRead(IO)
#define WRITE(IO,V) digitalWrite(IO,V)
#define WRITE_VAR(IO,V) WRITE(IO,V)
@ -55,6 +53,12 @@
#define GET_OUTPUT(IO)
#define GET_TIMER(IO)
#define PWM_PIN(p) digitalPinHasPWM(p)
#define USEABLE_HARDWARE_PWM(p) PWM_PIN(p)
//
// Pins Definitions
//
#define PORTA 0
#define PORTB 1
#define PORTC 2

6
Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h

@ -52,6 +52,12 @@
#define GET_OUTPUT(IO)
#define GET_TIMER(IO)
#define PWM_PIN(p) digitalPinHasPWM(p)
#define USEABLE_HARDWARE_PWM(p) PWM_PIN(p)
//
// Pins Definitions
//
#define PORTA 0
#define PORTB 1
#define PORTC 2

5
buildroot/share/tests/STM32F1_tests

@ -8,5 +8,8 @@ opt_set MOTHERBOARD BOARD_STM32F1R
opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT
exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT"
#cleanup
opt_enable SPINDLE_LASER_ENABLE
exec_test $1 $2 "STM32F1R SPINDLE_LASER_ENABLE"
# cleanup
restore_configs

Loading…
Cancel
Save