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