At the moment I’m desperately trying to adapt the firmware from Fireflies lume1 rev.B (orange one) to the modern version of Anduril 2. I use the following methodology: I got three sets of cfg and hwdef files: original lume1, kr4 from 675 (very similar to lume1), kr4 modern. Then I figure out how everything was renamed and rearranged and make changes accordingly to «new» lume1 files.
But I’m really stuck. So far I have managed to create hwdef.h, hwdef.c, anduril.h, etc files and build hex with which the torch at least turns on and responds to the button and clicks. However, at relatively high levels middle of the ramp and higher I observe strange jumps in the output level, like suddenly LESS - again MORE - again LESS and so on until we reach the ceiling of the ramp with the expected output level. Lower levels are OK. Turbo with FET working as expected.
PWM_LEVELS looks like this - so they are not the problem
#define PWM1_LEVELS 1,2,3,3,3,3,3,4,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,12,13,14,15,16,17,18,20,21,23,24,26,27,29,31,33,35,37,39,41,43,45,48,50,53,56,58,61,64,67,70,74,77,80,84,88,91,95,99,103,108,112,116,121,125,130,135,140,145,150,156,161,167,173,178,184,191,197,203,210,217,223,230,238,245,252,260,268,275,283,292,300,308,317,326,335,344,353,363,372,382,392,402,413,423,434,445,456,467,478,490,502,514,526,538,551,563,576,589,603,616,630,644,658,672,687,702,717,732,747,763,778,794,811,827,844,861,878,895,913,931,949,967,985,1004,1023,0
#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1023
Maybe root of the problem in new logic in set_level_main and gradual_tick_main and «dynamic PWM» itself, but I’m stuck and if somebody willing to point me direction I would really appreciate that