-
-
Notifications
You must be signed in to change notification settings - Fork 710
Implement LED switching #5574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implement LED switching #5574
Conversation
|
model | device_test | click_test | persistence_test |
---|---|---|---|
T2T1 | |||
T3B1 | |||
T3T1 | |||
T3W1 |
Latest CI run: 17175285187
return; | ||
} | ||
|
||
driver->enabled = enabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we turn off the LED here too? (similar to how it was done in other drivers)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say yes. It follows the same structure as the haptic driver drv2625.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree, lets turn in off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cepetr this PR touches some drivers code. Can you take a look? Thank you. |
4f37de2
to
9377ab3
Compare
|
||
while (pm_turn_on() != PM_OK) { | ||
rgb_led_set_color(0x400000); | ||
#ifdef USE_RGB_LED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we don't use LED, we don't need the delays either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
// Set RGB LED color | ||
// color: 24-bit RGB color, 0x00RRGGBB | ||
void rgb_led_set_color(uint32_t color); | ||
|
||
#define RGBLED_GREEN 0x040D04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably keep this for now but these values seem entirely UI-specific, so it should not be defined at driver level. i am thinking that the led blinking in bootloader should be seprate rust UI function exposed to bootloader
@@ -364,6 +364,7 @@ pub trait FirmwareUI { | |||
device_name: Option<TString<'static>>, | |||
paired_devices: Vec<TString<'static>, 1>, | |||
auto_lock_delay: TString<'static>, | |||
led: Option<bool>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the parameter name isn't very helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rgb_led_set_color(RGBLED_YELLOW); | ||
#endif | ||
systick_delay_ms(1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for delay without led
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return; | ||
} | ||
|
||
driver->enabled = enabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree, lets turn in off
[no changelog]
9377ab3
to
437a492
Compare
Enable LED switching off, similar to the haptic feedback.
Required by Figma
LED driver:
enabled
field in the driver structrgb_led_set_enabled
rgb_led_get_enabled
Device menu
show_device_menu
FwUI functionDeviceMenuResult
variantSyscalls
SYSCALL_RGB_LED_SET_ENABLED
SYSCALL_RGB_LED_GET_ENABLED
Python
rgb_led
withrgb_led_set_enabled
functionUSE_RGB_LED
Storage
set_rgb_led
andget_rgb_led()
functionsTODO