From 57e93ec2ed70c6b433d33d4951d8a20f4154c640 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Wed, 20 Aug 2014 15:42:09 +0200 Subject: Implemented QE invert option. --- main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 2bd2cad..5294b29 100644 --- a/main.cpp +++ b/main.cpp @@ -556,8 +556,11 @@ int main() { RCC.enable(RCC.TIM2); RCC.enable(RCC.TIM3); + if(!(config.flags & (1 << 1))) { + TIM2.CCER = 1 << 1; + } + TIM2.CCMR1 = (1 << 8) | (1 << 0); - TIM2.CCER = 1 << 1; TIM2.SMCR = 3; TIM2.CR1 = 1; @@ -567,8 +570,11 @@ int main() { TIM2.ARR = 256 - 1; } + if(!(config.flags & (1 << 2))) { + TIM3.CCER = 1 << 1; + } + TIM3.CCMR1 = (1 << 8) | (1 << 0); - TIM3.CCER = 1 << 1; TIM3.SMCR = 3; TIM3.CR1 = 1; -- cgit v1.2.3