diff options
-rw-r--r-- | cm3cpp_timer.cpp | 10 | ||||
-rw-r--r-- | cm3cpp_timer.h | 21 |
2 files changed, 21 insertions, 10 deletions
diff --git a/cm3cpp_timer.cpp b/cm3cpp_timer.cpp index 95ac204..adde1f5 100644 --- a/cm3cpp_timer.cpp +++ b/cm3cpp_timer.cpp @@ -223,7 +223,15 @@ auto Timer::set_master_mode(MasterMode mode) -> Result TIM_CR2(_timer) = (TIM_CR2(_timer) & ~TIM_CR2_MMS_MASK) | TIM_CR2_MMS_COMPARE_OC2REF ; break; - } + case COMPARE_OC3REF: + TIM_CR2(_timer) = (TIM_CR2(_timer) & ~TIM_CR2_MMS_MASK) | + TIM_CR2_MMS_COMPARE_OC3REF; + break; + case COMPARE_OC4REF: + TIM_CR2(_timer) = (TIM_CR2(_timer) & ~TIM_CR2_MMS_MASK) | + TIM_CR2_MMS_COMPARE_OC4REF; + break; + } return OK; } diff --git a/cm3cpp_timer.h b/cm3cpp_timer.h index 11f4873..5392020 100644 --- a/cm3cpp_timer.h +++ b/cm3cpp_timer.h @@ -70,16 +70,19 @@ public: TIMER_CLOCK_MUL_4 }; - enum MasterMode { - MASTER_RESET, - ENABLE, - UPDATE, - COMPARE_PULSE, - COMPARE_OC1REF, - COMPARE_OC2REF - }; + enum MasterMode + { + MASTER_RESET, + ENABLE, + UPDATE, + COMPARE_PULSE, + COMPARE_OC1REF, + COMPARE_OC2REF, + COMPARE_OC3REF, + COMPARE_OC4REF, + }; - enum SlaveMode { + enum SlaveMode { DISABLED, SLAVE_RESET, GATED, |