Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b3551b2
[driver] Remove Resumable functions macros
salkinium Aug 23, 2025
cba94a0
[driver] Remove ResumableResult type
salkinium Aug 23, 2025
e6f4a36
[driver] Replace resumable.hpp include with fiber.hpp
salkinium Aug 23, 2025
135598a
[driver] Remove inheriting from NestedResumable
salkinium Aug 23, 2025
61ecf83
[driver] Replace :processing:resumable -> :architecture:fiber
salkinium Aug 23, 2025
b5e7773
[driver] Remove nesting level from I2cDevice
salkinium Aug 23, 2025
b16c2cd
[driver] Compactify I2cDevice transaction functions
salkinium Aug 23, 2025
f0ac1e0
[driver] Replace timeout.isExpired() with sleep_for()
salkinium Aug 23, 2025
19159aa
[driver] Refactor Protothread update() methods
salkinium Aug 23, 2025
99c69b5
[driver] Replace Timeout with this_fiber::sleep_for
salkinium Aug 23, 2025
80fcdd5
[driver] Replace Blocking() functions
salkinium Aug 23, 2025
54dc1ac
[driver] Replace delay with sleep_for
salkinium Aug 23, 2025
7b21151
[platform] Remove resumable implementation of SPI
salkinium Aug 24, 2025
211f24e
[comms] Remove Resumables from AMNB protocol
salkinium Aug 23, 2025
a71377a
[driver] Move QMC5883 driver into modm namespace
salkinium Aug 23, 2025
a489c10
[interface] Fix missing dependency for uart.device
salkinium Aug 23, 2025
bd248dd
[storage] Fix checking both results in block device mirror
salkinium Aug 24, 2025
e914340
[driver] Refactor AD7280A driver to use SpiDevice
salkinium Aug 24, 2025
87d7a6c
[driver] Fix missing include in BMP085 driver
salkinium Aug 24, 2025
dddfa13
[clock] Allow overriding the clock implementation functions
salkinium Aug 24, 2025
ab52984
[test] Mock clock uses real clock by default
salkinium Aug 24, 2025
578a082
[ci] Remove boost examples from macOS CI
salkinium Aug 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Hosted Examples
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py linux)
(cd examples/linux && ../../tools/scripts/examples_compile.py block_device assert build_info etl fiber git logger printf threads)

- name: Compile STM32 Examples
if: always()
Expand Down
1 change: 1 addition & 0 deletions examples/avr/display/hd44780/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<module>modm:driver:hd44780</module>
<module>modm:platform:gpio</module>
<module>modm:platform:core</module>
<module>modm:platform:clock</module>
<module>modm:build:scons</module>
</modules>
</library>
4 changes: 2 additions & 2 deletions examples/avr/qmc5883l/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using namespace Board;
using namespace std::chrono_literals;

using Compass = Qmc5883l<I2cMaster>;
using Compass = modm::Qmc5883l<I2cMaster>;
Compass::Data data;
Compass compass(data);
modm::atomic::Flag dataReady(true);
Expand Down Expand Up @@ -54,7 +54,7 @@ main()
<< modm::endl;
} else
{
MODM_LOG_INFO << "readDataBlocking(): Error: " << uint8_t(I2cMaster::getErrorState())
MODM_LOG_INFO << "readData(): Error: " << uint8_t(I2cMaster::getErrorState())
<< modm::endl;
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/generic/ros/environment/thread_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DisplayThread::update()
// Wait for 100 msec unitl display powered up.
modm::this_fiber::sleep_for(100ms);

display.initializeBlocking();
display.initialize();
display.setFont(modm::font::Assertion);
display.clear();
display << "Hello World!";
Expand Down
4 changes: 2 additions & 2 deletions examples/nucleo_f042k6/spi_dma/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ int main()
uint8_t receiveBuffer[13];

// send out 12 bytes, don't care about response
Spi::transferBlocking(sendBuffer, nullptr, 12);
Spi::transfer(sendBuffer, nullptr, 12);

// send out 12 bytes, read in 12 bytes
Spi::transferBlocking(sendBuffer, receiveBuffer, 12);
Spi::transfer(sendBuffer, receiveBuffer, 12);
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/nucleo_f303re/spi_dma/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ int main()
uint8_t receiveBuffer[13];

// send out 12 bytes, don't care about response
Spi::transferBlocking(sendBuffer, nullptr, 12);
Spi::transfer(sendBuffer, nullptr, 12);

// send out 12 bytes, read in 12 bytes
Spi::transferBlocking(sendBuffer, receiveBuffer, 12);
Spi::transfer(sendBuffer, receiveBuffer, 12);
}

return 0;
Expand Down
1 change: 1 addition & 0 deletions examples/nucleo_f401re/distance_vl53l0/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<module>modm:driver:vl53l0</module>
<module>modm:platform:i2c:1</module>
<module>modm:processing:fiber</module>
<module>modm:processing:timer</module>
<module>modm:build:scons</module>
</modules>
</library>
16 changes: 8 additions & 8 deletions examples/nucleo_g071rb/amnb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,14 @@ Listener listeners[] =
};
Action actions[] =
{
{1, []() -> Response
{1, [counter=uint8_t{}]() mutable -> Response
{
static uint8_t counter{0};
MODM_LOG_INFO << "Node1 or Node3 received Action 1" << modm::endl;
return counter++;
}
},
{2, [](const uint32_t& data) -> Response
{2, [counter=uint8_t{}](const uint32_t& data) mutable -> Response
{
static uint8_t counter{0};
MODM_LOG_INFO << "Node1 or Node3 received Action 2 with argument: " << data << modm::endl;
return ErrorResponse(counter++);
}
Expand Down Expand Up @@ -82,15 +80,17 @@ modm::Fiber fiber_demo([]
node1.broadcast(1, counter++);
node3.broadcast(2);

auto res1 = node2.request<uint8_t>(1, 1);
auto res1 = node1.request<uint8_t>(1, 1);
MODM_LOG_INFO << "Node1 responded with: " << res1.error();
if (res1) { MODM_LOG_INFO << " " << *res1 << modm::endl; }
if (res1) { MODM_LOG_INFO << " " << *res1; }
MODM_LOG_INFO << modm::endl;

auto res2 = node1.request<uint8_t, uint8_t>(3, 2, counter);
MODM_LOG_INFO << "Node3 responded with: " << res2.error();
MODM_LOG_INFO << "Node1 responded with: " << res2.error();
if (res2.hasUserError()) {
MODM_LOG_INFO << " " << *res2.userError() << modm::endl;
MODM_LOG_INFO << " " << *res2.userError();
}
MODM_LOG_INFO << modm::endl;

if (counter % 10 == 0)
{
Expand Down
4 changes: 2 additions & 2 deletions examples/nucleo_l432kc/spi_dma/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ int main()
uint8_t receiveBuffer[13];

// send out 12 bytes, don't care about response
Spi::transferBlocking(sendBuffer, nullptr, 12);
Spi::transfer(sendBuffer, nullptr, 12);

// send out 12 bytes, read in 12 bytes
Spi::transferBlocking(sendBuffer, receiveBuffer, 12);
Spi::transfer(sendBuffer, receiveBuffer, 12);
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/nucleo_l432kc/uart_spi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ main()

while (true)
{
UartSpiMaster1::transferBlocking(0xF0);
UartSpiMaster1::transfer(0xF0);
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/rp_pico/spi_dma/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ int main()
usb_stream0 << "Spi tx only" << modm::endl;
tud_task();
// send out 12 bytes, don't care about response
Spi::transferBlocking(sendBuffer, nullptr, 12);
Spi::transfer(sendBuffer, nullptr, 12);

usb_stream0 << "Spi send \"" << reinterpret_cast<const char*>(sendBuffer) << "\"" << modm::endl;
tud_task();
// send out 12 bytes, read in 12 bytes
Spi::transferBlocking(sendBuffer, receiveBuffer, 12);
Spi::transfer(sendBuffer, receiveBuffer, 12);
receiveBuffer[12] = 0;
usb_stream0 << "Spi received \"" << reinterpret_cast<const char*>(receiveBuffer) << "\"" << modm::endl;
tud_task();
Expand Down
2 changes: 1 addition & 1 deletion examples/samg55_xplained_pro/spi-loopback/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main()
uint8_t tx[] = {0xa5, 0x21};
uint8_t rx[2];

SpiMaster0::transferBlocking(tx, rx, 2);
SpiMaster0::transfer(tx, rx, 2);

if(rx[0] == 0xa5 && rx[1] == 0x21) {
flash_time_ms = 500;
Expand Down
2 changes: 1 addition & 1 deletion examples/stm32f4_discovery/display/ssd1306/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ main()
MyI2cMaster::connect<Scl::Scl, Sda::Sda>();
MyI2cMaster::initialize<Board::SystemClock, 420_kHz>();

display.initializeBlocking();
display.initialize();
display.setFont(modm::font::Assertion);
display << "Hello World!";
display.update();
Expand Down
2 changes: 1 addition & 1 deletion examples/stm32f4_discovery/spi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ main()
while (true)
{
// Connect Mosi to Miso to create a loopback
data = SpiMaster::transferBlocking(data);
data = SpiMaster::transfer(data);
data++;
// This will be spamming the bus
}
Expand Down
2 changes: 1 addition & 1 deletion examples/stm32f4_discovery/uart_spi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ main()

while (true)
{
UartSpiMaster2::transferBlocking(0xF0);
UartSpiMaster2::transfer(0xF0);
}

return 0;
Expand Down
1 change: 0 additions & 1 deletion examples/stm32f746g_discovery/tmp102/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <modm/board.hpp>

#include <modm/processing/timer.hpp>
#include <modm/processing/protothread.hpp>
#include <modm/driver/temperature/tmp102.hpp>

typedef I2cMaster1 MyI2cMaster;
Expand Down
13 changes: 6 additions & 7 deletions src/modm/architecture/interface/block_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define MODM_INTERFACE_BLOCK_DEVICE_HPP

#include <stdint.h>
#include <modm/processing/resumable.hpp>

namespace modm
{
Expand All @@ -40,11 +39,11 @@ class BlockDevice
#ifdef __DOXYGEN__
public:
/// Initializes the storage hardware
modm::ResumableResult<bool>
bool
initialize();

/// Deinitializes the storage hardware
modm::ResumableResult<bool>
bool
deinitialize();

/** Read data from one or more blocks
Expand All @@ -54,7 +53,7 @@ class BlockDevice
* @param size Size to read in bytes (multiple of read block size)
* @return True on success
*/
modm::ResumableResult<bool>
bool
read(uint8_t *buffer, bd_address_t address, bd_size_t size);

/** Program blocks with data
Expand All @@ -66,7 +65,7 @@ class BlockDevice
* @param size Size to write in bytes (multiple of read block size)
* @return True on success
*/
modm::ResumableResult<bool>
bool
program(const uint8_t *buffer, bd_address_t address, bd_size_t size);

/** Erase blocks
Expand All @@ -77,7 +76,7 @@ class BlockDevice
* @param size Size to erase in bytes (multiple of read block size)
* @return True on success
*/
modm::ResumableResult<bool>
bool
erase(bd_address_t address, bd_size_t size);

/** Writes data to one or more blocks after erasing them
Expand All @@ -89,7 +88,7 @@ class BlockDevice
* @param size Size to write in bytes (multiple of read block size)
* @return True on success
*/
modm::ResumableResult<bool>
bool
write(const uint8_t *buffer, bd_address_t address, bd_size_t size);

public:
Expand Down
Loading
Loading