Closed cnrd closed 1 year ago
Seems like I should just search a bit: https://github.com/danielnilsson9/bbs-fw/issues/12
I could probably do it during initialisation, but seems like there are some safety checks happening between the init and when the light sub-board is actually enabled in app.c.
@danielnilsson9 Do you think it's "safe" to enable to the light during the initialisation or should I do it later?
All ebikes where I live need to have lights always on.
The problem I had is that my display (DPC-18) sends the lights on/off status periodically so even if you enable in lights_init it will get turned off again in app.c.
I've added what I do here with a cfgstore value to the tool and firmware. https://github.com/dav0000000/bbs-fw
The changes seem pretty simple. @danielnilsson9 might want to have a quick look if you can. https://github.com/dav0000000/bbs-fw/commit/6dc8f0ffe627d9f687c06fd9ceca0904068fa67a
Looks good to have it configurable 👍I think you may also want to call lights_enable, if you are calling lights_set(true) in lights_init() otherwise the power board is not correctly powered until after init has finished.On 2 Jul 2023, at 20.07, dav0000000 @.> wrote: All ebikes where I live need to have lights always on. The problem I had is that my display (DPC-18) sends the lights on/off status periodically so even if you enable in lights_init it will get turned off again in app.c. I've added what I do here with a cfgstore value to the tool and firmware. https://github.com/dav0000000/bbs-fw The changes seem pretty simple. @danielnilsson9 might want to have a quick look if you can. @.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
I do have lights_enable in my own code so you could very well be right. I just didn't change it here as figured the app_process lvc check code would be enough to enable it. I don't have that lvc check in my code as it looks to me that it might turn the lights off when I don't want.
The light control is on a separate PCB attached to the main PCB with a separate DCDC step down converter for 6V power to the light. PIN_LIGHTS_POWER powers on the step down converter I think and PIN_LIGHTS just toggle the output transistor controlling the lights.
Yes, this might be a reasonable config option to have, might add it at some point, PR:s are also welcome.
I have created the PR to merge if it's suitable. Thanks Daniel.
Hi
I have been looking at the lights.c code, but I'm having a bit of difficulty understanding the difference between the
PIN_LIGHTS_POWER
and thePIN_LIGHTS
.Following the method calls, it seems like calling
lights_set(true)
should turn on the lights (As that is what it does when the display sends a light on command), but I guess that I also need to call lights_enable.Is it enough to just change both of the in
lights_init
?I could just try, but I'm also trying to understand a bit ;-)