mbv: add async app, sorta works
This commit is contained in:
15
mbv/apps/async/uart_async.h
Normal file
15
mbv/apps/async/uart_async.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#include "async.h"
|
||||
#include "buffer.h"
|
||||
|
||||
async::task<buffer> UartRead(int size);
|
||||
async::task<uint8_t> UartReadLoop();
|
||||
async::task<> UartWrite(std::span<const std::byte> data);
|
||||
inline async::task<> UartWrite(std::string_view s) {
|
||||
co_await UartWrite(std::as_bytes(std::span{s.data(), s.size()}));
|
||||
}
|
||||
async::task<> UartWriteLoop(async::gimme<std::span<const std::byte>>& data);
|
||||
Reference in New Issue
Block a user