File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333#include "timer.h"
3434#include "servo.h"
3535
36+ #if MICROPY_HW_ENABLE_SERVO
37+
3638// This file implements the pyb.Servo class which controls standard hobby servo
3739// motors that have 3-wires (ground, power, signal).
3840//
@@ -328,3 +330,5 @@ const mp_obj_type_t pyb_servo_type = {
328330 .make_new = pyb_servo_make_new ,
329331 .locals_dict = (mp_obj_dict_t * )& pyb_servo_locals_dict ,
330332};
333+
334+ #endif // MICROPY_HW_ENABLE_SERVO
Original file line number Diff line number Diff line change @@ -216,9 +216,11 @@ TIM_HandleTypeDef *timer_tim6_init(uint freq) {
216216
217217// Interrupt dispatch
218218void HAL_TIM_PeriodElapsedCallback (TIM_HandleTypeDef * htim ) {
219+ #if MICROPY_HW_ENABLE_SERVO
219220 if (htim == & TIM5_Handle ) {
220221 servo_timer_irq_callback ();
221222 }
223+ #endif
222224}
223225
224226// Get the frequency (in Hz) of the source clock for the given timer.
You can’t perform that action at this time.
0 commit comments