pseudo_rand implicit declaration when undef USE_CANDLE_MODE

Bug #1930468 reported by Rob Carlson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Flashlight Firmware Repository
New
Undecided
Unassigned

Bug Description

anduril2 591

If using #undef USE_CANDLE_MODE in config-default.h, aux-capable Emisar/Noctigon builds fail with message:

In file included from anduril.c:161:0:
aux-leds.c: In function ‘rgb_led_update’:
aux-leds.c:115:34: warning: implicit declaration of function ‘pseudo_rand’ [-Wimplicit-function-declaration]
         rainbow = (rainbow + 1 + pseudo_rand() % 5) % 6;

anduril.o: In function `rgb_led_update':
anduril2/ToyKeeper/spaghetti-monster/anduril/aux-leds.c:78: undefined reference to `pseudo_rand'

Adding statement #define USE_PSEUDO_RAND to config-default.h immediately after the undef fixes build issues.

Revision history for this message
mkozlowski (empeka) wrote :

I think that proper way for now is:

diff --git a/spaghetti-monster/anduril/strobe-modes-fsm.h b/spaghetti-monster/anduril/strobe-modes-fsm.h
index 7087796..0c319d2 100644
--- a/spaghetti-monster/anduril/strobe-modes-fsm.h
+++ b/spaghetti-monster/anduril/strobe-modes-fsm.h
@@ -21,7 +21,7 @@
 #define STROBE_MODES_FSM_H

 // enable the random number generator if we need it
-#if defined(USE_LIGHTNING_MODE) || defined(USE_CANDLE_MODE)
+#if defined(USE_LIGHTNING_MODE) || defined(USE_CANDLE_MODE) || defined(USE_AUX_RGB_LEDS)
 #define USE_PSEUDO_RAND
 #endif

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.