Skip to content

Commit

Permalink
small issue fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Apr 24, 2024
1 parent d3766b8 commit b98fea4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
18 changes: 3 additions & 15 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
Expand All @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions src/keyboards/nuphy-air60/layouts/default/indicators.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions src/platform/sh68f90a/pwm.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "pwm.h"
#include <stdint.h>
#include <stdio.h>
#include "matrix.h"

/*
# Columns
Expand Down
4 changes: 2 additions & 2 deletions src/platform/sh68f90a/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b98fea4

Please sign in to comment.