Skip to content

Commit

Permalink
Added remote call capabilities to some LEDControl features
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Fleissner <[email protected]>
  • Loading branch information
Florian Fleissner committed Jan 16, 2020
1 parent 83be51a commit eff4062
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/kaleidoscope/plugin/LEDControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "kaleidoscope/Runtime.h"
#include "kaleidoscope/plugin/LEDMode.h"
#include "kaleidoscope/remote_call.h"

#define LED_TOGGLE B00000001 // Synthetic, internal

Expand Down Expand Up @@ -176,3 +177,25 @@ class FocusLEDCommand : public Plugin {

extern kaleidoscope::plugin::LEDControl LEDControl;
extern kaleidoscope::plugin::FocusLEDCommand FocusLEDCommand;

KALEIDOSCOPE_REMOTE_CALL(
KRC_ROOT_PACKAGE(plugin,
KRC_PACKAGE(LEDControl,
KRC_F(setCrgbAt, KRC_NO_RESULTS,
((uint8_t, row), (uint8_t, col),
(uint8_t, red), (uint8_t, green), (uint8_t, blue)),
(LEDControl.setCrgbAt(KeyAddr{args->row, args->col},
CRGB(args->red, args->green, args->blue));),
KRC_DESCRIPTION("Sets the LED color of a single key")
)
KRC_F(setMode, KRC_NO_RESULTS, ((uint8_t, mode_id)),
(LEDControl.set_mode(args->mode_id);),
KRC_DESCRIPTION("Sets the LED mode")
)
KRC_F(getMode, ((uint8_t, mode_id)), KRC_NO_ARGS,
(results->mode_id = LEDControl.get_mode_index();),
KRC_DESCRIPTION("Queries the LED mode")
)
)
)
)

0 comments on commit eff4062

Please sign in to comment.