Skip to content

Commit

Permalink
conditional rf_controller include
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Jul 20, 2024
1 parent dec8fb1 commit 2a3372e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/keyboards/nuphy-air60/kbdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@
#define CONN_MODE_SWITCH_P5_5 _P5_5 // 1 - USB, 0 - RF
#define OS_MODE_SWITCH_P5_6 _P5_6 // 1 - MAC, 0 - WIN

#define RF_ENABLED 1

#define RF_BB_SPI_CS P7_4
#define RF_BB_SPI_SCK P4_7
#define RF_BB_SPI_MISO P0_6
Expand Down
6 changes: 5 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#include "keyboard.h"
#include "user_init.h"
#include "indicators.h"
#include "rf_controller.h"
#if RF_ENABLED == 1
# include "rf_controller.h"
#endif

#include "pwm.h" // TODO: interrupt is defined here and need to be imported in main, centralise interupt definitions

Expand Down Expand Up @@ -53,7 +55,9 @@ void main()
dprintf("SMK v" TOSTRING(SMK_VERSION) "\r\n");
dprintf("DEVICE vId:" TOSTRING(USB_VID) " pId:" TOSTRING(USB_PID) "\n\r");

#if RF_ENABLED == 1
rf_init();
#endif

// enable pwm and interrupt (driving matrix scan)
indicators_start();
Expand Down
7 changes: 6 additions & 1 deletion src/smk/host.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#include "host.h"
#include "debug.h"
#include "usb.h"
#include "rf_controller.h"

#if RF_ENABLED == 1
# include "rf_controller.h"
#endif

/* send report */
void host_keyboard_send(report_keyboard_t *report)
{
usb_send_report(report);
#if RF_ENABLED == 1
rf_send_report(report);
#endif
}

0 comments on commit 2a3372e

Please sign in to comment.