MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / UpdateLed

Function UpdateLed

src/CAN/CanInterface.cpp:231–251  ·  view source on GitHub ↗

This is called only from the CAN clock loop, so inline

Source from the content-addressed store, hash-verified

229
230// This is called only from the CAN clock loop, so inline
231static inline void UpdateLed(uint32_t stepClocks) noexcept
232{
233#if SUPPORT_MULTICAST_DISCOVERY
234 if (identifying)
235 {
236 if (identTotalClocks != 0 && stepClocks - identInitialClocks >= identTotalClocks)
237 {
238 identifying = 0; // stop identifying
239 }
240 else
241 {
242 // Blink the LED fast. This function gets called every 200ms, so that's the fastest we can blink it without having another task do it.
243 reprap.GetPlatform().InvertDiagLed();
244 return;
245 }
246 }
247#endif
248
249 // Blink the LED at about 1Hz. Duet 3 expansion boards will blink in sync when they have established clock sync with us.
250 reprap.GetPlatform().SetDiagLed((stepClocks & (1u << 19)) != 0);
251}
252
253static void InitReceiveFilters() noexcept
254{

Callers 1

CanClockLoopFunction · 0.85

Calls 2

InvertDiagLedMethod · 0.80
SetDiagLedMethod · 0.80

Tested by

no test coverage detected