diff --git a/core/embed/projects/kernel/main.c b/core/embed/projects/kernel/main.c index f252907bd8..2ff4f4f4c0 100644 --- a/core/embed/projects/kernel/main.c +++ b/core/embed/projects/kernel/main.c @@ -63,6 +63,10 @@ #include #endif +#ifdef USE_RGB_LED +#include +#endif + #ifdef SYSTEM_VIEW #include #endif diff --git a/core/embed/sys/syscall/stm32/syscall_dispatch.c b/core/embed/sys/syscall/stm32/syscall_dispatch.c index f085089987..076acde171 100644 --- a/core/embed/sys/syscall/stm32/syscall_dispatch.c +++ b/core/embed/sys/syscall/stm32/syscall_dispatch.c @@ -51,6 +51,10 @@ #include #endif +#ifdef USE_RGB_LED +#include +#endif + #ifdef USE_SD_CARD #include #endif @@ -412,6 +416,13 @@ __attribute((no_stack_protector)) void syscall_handler(uint32_t *args, } break; #endif +#ifdef USE_RGB_LED + case SYSCALL_RGB_LED_SET_COLOR: { + uint32_t color = args[0]; + rgb_led_set_color(color); + } break; +#endif + #ifdef USE_HAPTIC case SYSCALL_HAPTIC_SET_ENABLED: { bool enabled = (args[0] != 0); diff --git a/core/embed/sys/syscall/stm32/syscall_numbers.h b/core/embed/sys/syscall/stm32/syscall_numbers.h index 0f0c1ad666..6603a03db1 100644 --- a/core/embed/sys/syscall/stm32/syscall_numbers.h +++ b/core/embed/sys/syscall/stm32/syscall_numbers.h @@ -92,6 +92,8 @@ typedef enum { SYSCALL_TOUCH_GET_EVENT, + SYSCALL_RGB_LED_SET_COLOR, + SYSCALL_HAPTIC_SET_ENABLED, SYSCALL_HAPTIC_GET_ENABLED, SYSCALL_HAPTIC_TEST, diff --git a/core/embed/sys/syscall/stm32/syscall_stubs.c b/core/embed/sys/syscall/stm32/syscall_stubs.c index 614b02378d..a939541592 100644 --- a/core/embed/sys/syscall/stm32/syscall_stubs.c +++ b/core/embed/sys/syscall/stm32/syscall_stubs.c @@ -385,6 +385,19 @@ uint32_t touch_get_event(void) { #endif +// ============================================================================= +// rgb_led.h +// ============================================================================= + +#ifdef USE_RGB_LED + +#include +void rgb_led_set_color(uint32_t color) { + syscall_invoke1(color, SYSCALL_RGB_LED_SET_COLOR); +} + +#endif + // ============================================================================= // haptic.h // =============================================================================