Skip to content

jancumps/pico-lean-stream-io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pico port of Lean stream IO by Steve Bush

Documentation blog post

example code:

#include <stdio.h>
#include "pico/stdio.h"
#include "filestream.hpp"

namespace mcu
{
    FileStream debug(1);
}

int main(int, char** )
{
    stdio_init_all();

    mcu::debug << "Hello, world!\r\n";

    mcu::debug << mcu::FileStream::RadixEnum::Hexadecimal << 6 << "\r\n";

    while (true) continue;
}

CMake file configuration:

# add_subdirectory()
pico_add_subdirectory(lean_stream_io)

# ...

target_link_libraries(${CMAKE_PROJECT_NAME}
        pico_stdlib
        lean_stream_io
        )

# adjust to enable stdio via usb, or uart
pico_enable_stdio_usb(${CMAKE_PROJECT_NAME} 0)
pico_enable_stdio_uart(${CMAKE_PROJECT_NAME} 1)

steve's github repo

video: Modern C++: C++ Patterns to Make Embedded Programming More Productive - Steve Bush - CppCon 2022
slides: Modern C++: C++ Patterns to Make Embedded Programming More Productive - Steve Bush - CppCon 2022