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

Add spiTransfer function to Native to support Linux-managed CS #3524

Merged
merged 3 commits into from
Apr 1, 2024
Merged
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
2 changes: 1 addition & 1 deletion arch/portduino/portduino.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
[portduino_base]
platform = https://github.com/meshtastic/platform-native.git#1b8a32c60ab7495026033858d53c737f7d1cb34a
platform = https://github.com/meshtastic/platform-native.git#117acc5e7fcc2047e9ba1dc11789daea26fc36d2
framework = arduino

build_src_filter =
Expand Down
6 changes: 6 additions & 0 deletions src/mesh/RadioLibInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ void LockingArduinoHal::spiEndTransaction()

ArduinoHal::spiEndTransaction();
}
#if ARCH_PORTDUINO
void LockingArduinoHal::spiTransfer(uint8_t *out, size_t len, uint8_t *in)
{
spi->transfer(out, in, len);
}
#endif

RadioLibInterface::RadioLibInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
RADIOLIB_PIN_TYPE busy, PhysicalLayer *_iface)
Expand Down
3 changes: 3 additions & 0 deletions src/mesh/RadioLibInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class LockingArduinoHal : public ArduinoHal

void spiBeginTransaction() override;
void spiEndTransaction() override;
#if ARCH_PORTDUINO
void spiTransfer(uint8_t *out, size_t len, uint8_t *in) override;
#endif
};

#if defined(USE_STM32WLx)
Expand Down
1 change: 1 addition & 0 deletions variants/portduino/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
#define CANNED_MESSAGE_MODULE_ENABLE 1
#define HAS_GPS 1
#define MAX_NUM_NODES settingsMap[maxnodes]
#define RADIOLIB_GODMODE 1
Loading