|
11 | 11 | The accuracy is nearly perfect compared to software timers. The most important feature is they're ISR-based timers |
12 | 12 | Therefore, their executions are not blocked by bad-behaving functions / tasks. |
13 | 13 | This important feature is absolutely necessary for mission-critical tasks. |
14 | | -
|
15 | | - Based on SimpleTimer - A timer library for Arduino. |
16 | | - |
17 | | - Copyright (c) 2010 OTTOTECNICA Italy |
18 | | -
|
19 | | - Based on BlynkTimer.h |
20 | | - Author: Volodymyr Shymanskyy |
21 | | -
|
22 | | - Version: 1.3.0 |
23 | | -
|
24 | | - Version Modified By Date Comments |
25 | | - ------- ----------- ---------- ----------- |
26 | | - 1.0.1 K Hoang 22/11/2020 Initial coding and sync with NRF52_TimerInterrupt |
27 | | - 1.0.2 K Hoang 23/11/2020 Add and optimize examples |
28 | | - 1.1.1 K.Hoang 06/12/2020 Add Change_Interval example. Bump up version to sync with other TimerInterrupt Libraries |
29 | | - 1.2.0 K.Hoang 11/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage |
30 | | - 1.2.1 K.Hoang 04/05/2021 Add mbed_nano to list of compatible architectures |
31 | | - 1.3.0 K.Hoang 09/09/2021 Don't use NRF_TIMER_1 because of mbed_nano core v2.0.0+ |
32 | 14 | *****************************************************************************************************************************/ |
33 | 15 | /* |
34 | 16 | Notes: |
|
51 | 33 | */ |
52 | 34 |
|
53 | 35 | #if !( ARDUINO_ARCH_NRF52840 && TARGET_NAME == ARDUINO_NANO33BLE ) |
54 | | -#error This code is designed to run on nRF52-based Nano-33-BLE boards using mbed-RTOS platform! Please check your Tools->Board setting. |
| 36 | + #error This code is designed to run on nRF52-based Nano-33-BLE boards using mbed-RTOS platform! Please check your Tools->Board setting. |
55 | 37 | #endif |
56 | 38 |
|
57 | 39 | // These define's must be placed at the beginning before #include "NRF52TimerInterrupt.h" |
58 | 40 | // _TIMERINTERRUPT_LOGLEVEL_ from 0 to 4 |
59 | 41 | // Don't define _TIMERINTERRUPT_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. |
60 | 42 | // For Nano33-BLE, don't use Serial.print() in ISR as system will definitely hang. |
61 | 43 | #define TIMER_INTERRUPT_DEBUG 1 |
62 | | -#define _TIMERINTERRUPT_LOGLEVEL_ 0 |
| 44 | +#define _TIMERINTERRUPT_LOGLEVEL_ 3 |
63 | 45 |
|
| 46 | +// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error |
64 | 47 | #include "NRF52_MBED_TimerInterrupt.h" |
65 | 48 |
|
66 | 49 | #ifndef LED_BUILTIN |
67 | | -#define LED_BUILTIN D13 |
| 50 | + #define LED_BUILTIN D13 |
68 | 51 | #endif |
69 | 52 |
|
70 | 53 | #ifndef LED_BLUE |
71 | | -#define LED_BLUE D7 |
| 54 | + #define LED_BLUE D7 |
72 | 55 | #endif |
73 | 56 |
|
74 | 57 | #ifndef LED_RED |
75 | | -#define LED_RED D8 |
| 58 | + #define LED_RED D8 |
76 | 59 | #endif |
77 | 60 |
|
78 | 61 | // For PWM_Value from 0-255.You can change to 1024 or 2048 |
|
0 commit comments