sctimer_on is only for LPC_SCT
authorNathael Pajani <nathael.pajani@ed3l.fr>
Fri, 28 Dec 2018 11:01:36 +0000 (12:01 +0100)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Fri, 10 Feb 2023 18:02:59 +0000 (19:02 +0100)
drivers/sctimers.c

index ea000ef..976d515 100644 (file)
@@ -268,18 +268,9 @@ int sctimer_on(uint8_t timer_num, uint32_t clkrate, void (*callback)(uint32_t))
        }
 
        /* Set main configurations */
-       if (timer_num == LPC_SCT) {
-               sct->config = (LPC_SCT_UNIFIED_TIMER | LPC_SCT_CLK_SYSCLK);
-               /* Reset and disable counter */
-               sct->control = (LPC_SCT_CLEAR | LPC_SCT_HALT | LPC_SCT_PRESCALE(prescale));
-       } else {
-               sct->config = LPC_SCT_CLK_SYSCLK;
-               if (timer_num == LPC_SCT16_T0) {
-                       sct->control = (LPC_SCT_CLEAR | LPC_SCT_HALT | LPC_SCT_PRESCALE(prescale));
-               } else {
-                       sct->control = ((LPC_SCT_CLEAR | LPC_SCT_HALT | LPC_SCT_PRESCALE(prescale)) << 16);
-               }
-       }
+       sct->config = (LPC_SCT_UNIFIED_TIMER | LPC_SCT_CLK_SYSCLK);
+       /* Reset and disable counter */
+       sct->control = (LPC_SCT_CLEAR | LPC_SCT_HALT | LPC_SCT_PRESCALE(prescale));
 
        /* Store the callback, OK even if none given */
        sctimer.callback = callback;