Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mr mennens tech gpio change #152

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build-rp2040.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: build-rp2040
on:
on:
push:
paths:
- 'firmware/**'
workflow_call:
workflow_dispatch:
defaults:
run:
shell: bash --noprofile --norc -x -e -o pipefail {0}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: release
on:
on:
push:
tags: 'r*'
workflow_dispatch:
jobs:
build-nrf52:
uses: ./.github/workflows/build-nrf52.yml
Expand Down
2 changes: 1 addition & 1 deletion firmware/src/boards/remapper_v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define HID_REMAPPER_BOARD_V8

#define ADC_ENABLED
#define NADCS 2
#define NADCS 3

// these settings are here to let this build be used on
// a regular Pico until we have a proper build with analog
Expand Down
8 changes: 6 additions & 2 deletions firmware/src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ void set_gpio_dir() {
for (uint8_t i = 0; i <= 29; i++) {
uint32_t bit = 1 << i;
if (gpio_valid_pins_mask & bit) {
gpio_set_pulls(i, gpio_in_mask & bit, false);
// (This Changes the GPIO Pull direction)
// Original: gpio_set_pulls(i, gpio_in_mask & bit, false);
gpio_set_pulls(i, false, gpio_in_mask & bit);
}
}
}
Expand Down Expand Up @@ -117,7 +119,9 @@ bool read_gpio(uint64_t now) {
if (changed & bit) {
if (last_gpio_change[i] + gpio_debounce_time <= now) {
uint32_t usage = GPIO_USAGE_PAGE | i;
int32_t state = !(gpio_state & bit); // active low
// (This Changes the GPIO Pull direction)
// Original: int32_t state = !(gpio_state & bit); // active low
int32_t state = !!(gpio_state & bit);
set_input_state(usage, state);
if (monitor_enabled) {
monitor_usage(usage, state, 0);
Expand Down