Skip to content

fix: reduce current usage on STM32-based hosts when using TXNs #146

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

Merged
merged 1 commit into from
Aug 8, 2025
Merged
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
13 changes: 13 additions & 0 deletions src/NoteTxn_Arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ NoteTxn_Arduino::NoteTxn_Arduino
_rtx_pin(rtx_pin_)
{
// Float CTX/RTX to conserve energy
#ifdef ARDUINO_ARCH_STM32
::pinMode(_ctx_pin, INPUT_ANALOG);
::pinMode(_rtx_pin, INPUT_ANALOG);
#else
::pinMode(_ctx_pin, INPUT);
::pinMode(_rtx_pin, INPUT);
#endif
}

bool
Expand All @@ -84,7 +89,11 @@ NoteTxn_Arduino::start (
}

// Float CTX to conserve energy
#ifdef ARDUINO_ARCH_STM32
::pinMode(_ctx_pin, INPUT_ANALOG);
#else
::pinMode(_ctx_pin, INPUT);
#endif

// Abandon request on timeout
if (!result) {
Expand All @@ -100,7 +109,11 @@ NoteTxn_Arduino::stop (
)
{
// Float RTX pin
#ifdef ARDUINO_ARCH_STM32
::pinMode(_rtx_pin, INPUT_ANALOG);
#else
::pinMode(_rtx_pin, INPUT);
#endif
}

// Explicitly instantiate the template function for array types
Expand Down
Loading