diff --git a/meson.build b/meson.build index 018f34e..87926f5 100644 --- a/meson.build +++ b/meson.build @@ -91,29 +91,17 @@ lib_user = custom_target('user.lib', command : [sdar, sdar_args, '@OUTPUT@', '@INPUT@'], ) -rel_platform_sh68f90a = compiler.process(src_platform_sh68f90a) -lib_platform_sh68f90a = custom_target('platform_sh68f90a.lib', - input : rel_platform_sh68f90a, - output : 'platform_sh68f90a.lib', - command : [sdar, sdar_args, '@OUTPUT@', '@INPUT@'], -) - foreach part : parts keyboard = part[0] platform = part[1] foreach layout : part[2] - if platform == 'sh68f90a' - lib_platform = lib_platform_sh68f90a - else - error('unsupported platform: ' + platform) - endif - if keyboard == 'nuphy-air60' src_main += [ 'src/keyboards/nuphy-air60/smatrix.c', 'src/keyboards/nuphy-air60/layouts/default/indicators.c', 'src/keyboards/nuphy-air60/layouts/default/layout.c', ] + src_main += src_platform_sh68f90a inc_dirs += [ 'src/keyboards/nuphy-air60', ] @@ -127,8 +115,8 @@ foreach part : parts ihx_smk = custom_target(prefix + 'smk.ihx', input : rel_main, output : prefix + 'smk.ihx', - depends: [lib_platform, lib_user], - command : [cc, cc_args, '-o', '@OUTPUT@', '@INPUT@', '-l' + lib_platform.full_path(), '-l' + lib_user.full_path()], + depends: [lib_user], + command : [cc, cc_args, '-o', '@OUTPUT@', '@INPUT@', '-l' + lib_user.full_path()], ) hex_smk = custom_target(prefix + 'smk.hex', diff --git a/src/keyboards/nuphy-air60/layouts/default/indicators.c b/src/keyboards/nuphy-air60/layouts/default/indicators.c index 513000b..5285fef 100644 --- a/src/keyboards/nuphy-air60/layouts/default/indicators.c +++ b/src/keyboards/nuphy-air60/layouts/default/indicators.c @@ -34,10 +34,10 @@ bool indicators_update_step(keyboard_state_t *keyboard, uint8_t current_step) if (current_cycle < 1024) { blue_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle + 1024) % 2048) - 1024); red_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle) % 2048) - 1024); - } else if (current_cycle >= 1024 && current_cycle < 2048) { + } else if (current_cycle < 2048) { red_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle) % 2048) - 1024); green_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle + 1024) % 2048) - 1024); - } else if (current_cycle >= 2048) { + } else { green_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle + 1024) % 2048) - 1024); blue_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle) % 2048) - 1024); } diff --git a/src/platform/sh68f90a/pwm.c b/src/platform/sh68f90a/pwm.c index c42063d..8938fba 100644 --- a/src/platform/sh68f90a/pwm.c +++ b/src/platform/sh68f90a/pwm.c @@ -1,6 +1,7 @@ #include "pwm.h" #include #include +#include "matrix.h" /* # Columns diff --git a/src/platform/sh68f90a/usb.c b/src/platform/sh68f90a/usb.c index 4d0a053..71bc551 100644 --- a/src/platform/sh68f90a/usb.c +++ b/src/platform/sh68f90a/usb.c @@ -802,7 +802,7 @@ static void usb_get_endpoint_status_handler(__xdata struct usb_req_setup *req) static void usb_get_descriptor_handler(__xdata struct usb_req_setup *req) { - uint8_t *__xdata addr; + uint8_t *__xdata addr = NULL; uint16_t __xdata length; __xdata uint8_t *buf = scratch; @@ -976,7 +976,7 @@ static void usb_hid_set_protocol_handler(__xdata struct usb_req_setup *req) if (req->wIndex == 0) { interface0_protocol = req->wValue & 0xff; } else if (req->wIndex == 1) { - interface1_protocol = req->wValue && 0xff; + interface1_protocol = req->wValue & 0xff; } CLEAR_EP0_CNT;