forked from Jyers/Marlin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
FastPWM.txt
38 lines (28 loc) · 1.5 KB
/
FastPWM.txt
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
Set {&gpioa, &timer5, &adc1, 0, 1, 0}, /* PA0 */ in /Users/%USERPROFILE%/.platformio/packages/framework-arduinoststm32-maple/STM32F1/variants/generic_stm32f103r/boards.cpp
Commented #define FAN_SOFT_PWM in Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
Uncommented #define FAST_PWM_FAN in Marlin/Configuration.h
Commented #define FAN_SOFT_PWM in Marlin/Configuration.h (DO NOT comment out #define SOFT_PWM_SCALE 0)
Set #define STEP_TIMER_NUM 4 // for other boards, five is fine. in Marlin/src/HAL/STM32F1/timers.h
********************************************************************************************************
gcode.h:
********************************************************************************************************
...
+ static void M9891();
...
********************************************************************************************************
gcode.cpp:
********************************************************************************************************
...
+ case 9891: M9891(); break;
...
********************************************************************************************************
Add file gcode\M9891.cpp:
********************************************************************************************************
#include "../../inc/MarlinConfig.h"
#include "../gcode.h"
void GcodeSuite::M9891() {
const uint8_t pport = parser.byteval('P');
const uint16_t dfreq = parser.ushortval('F');
// Set frequency for port
set_pwm_frequency((pin_t)pport, (int)dfreq);
}