FastLED 3.9.15
Loading...
Searching...
No Matches
platforms.cpp
Go to the documentation of this file.
1
3
5#define FASTLED_INTERNAL
6
7// Removed duplicate weak definition of timer_millis for ATtiny1604.
8// The variable is already defined in avr_millis_timer_null_counter.hpp when needed,
9// so redefining it here caused multiple-definition linkage errors.
10
11// Provide a single consolidated weak timer_millis symbol for AVR tiny/x-y parts
12// whose cores do not export it, satisfying MS_COUNTER binding in led_sysdefs_avr.h.
13// This complements avr_millis_timer_null_counter.hpp when that TU is not built.
14#if defined(__AVR__)
15# if defined(__AVR_ATtiny1604__) || defined(ARDUINO_attinyxy6) || defined(__AVR_ATtinyxy6__) || defined(__AVR_ATtiny1616__)
16# ifdef __cplusplus
17extern "C" {
18# endif
19__attribute__((weak)) volatile unsigned long timer_millis = 0;
20# ifdef __cplusplus
21}
22# endif
23# endif
24#endif
25
26// Interrupt handlers cannot be defined in the header.
27// They must be defined as C functions, or they won't
28// be found (due to name mangling), and thus won't
29// override any default weak definition.
30#if defined(NRF52_SERIES)
31
32 #include "platforms/arm/nrf52/led_sysdefs_arm_nrf52.h"
33 #include "platforms/arm/nrf52/arbiter_nrf52.h"
34
35 uint32_t isrCount;
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 // NOTE: Update platforms.cpp in root of FastLED library if this changes
41 #if defined(FASTLED_NRF52_ENABLE_PWM_INSTANCE0)
42 void PWM0_IRQHandler(void) { ++isrCount; PWM_Arbiter<0>::isr_handler(); }
43 #endif
44 #if defined(FASTLED_NRF52_ENABLE_PWM_INSTANCE1)
45 void PWM1_IRQHandler(void) { ++isrCount; PWM_Arbiter<1>::isr_handler(); }
46 #endif
47 #if defined(FASTLED_NRF52_ENABLE_PWM_INSTANCE2)
48 void PWM2_IRQHandler(void) { ++isrCount; PWM_Arbiter<2>::isr_handler(); }
49 #endif
50 #if defined(FASTLED_NRF52_ENABLE_PWM_INSTANCE3)
51 void PWM3_IRQHandler(void) { ++isrCount; PWM_Arbiter<3>::isr_handler(); }
52 #endif
53 #ifdef __cplusplus
54 }
55 #endif
56
57#endif // defined(NRF52_SERIES)
58
59
60
61// FASTLED_NAMESPACE_BEGIN
62// FASTLED_NAMESPACE_END