poly-1-fw/stor.cpp

39 lines
546 B
C++

// intellectual property is bullshit bgdc
#include "stor.hpp"
#include <stdbool.h>
#include <stddef.h>
#include <inttypes.h>
#include <util/atomic.h>
uint8_t stor_buffer[STOR_SIZE];
size_t stor_cursor;
uint32_t stor_block_memo;
volatile bool stor_locked;
bool stor_try_lock()
{
ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
{
bool was_locked = stor_locked;
stor_locked = true;
return !was_locked;
}
}
void stor_unlock()
{
stor_locked = false;
}
bool stor_read(size_t block)
{
return true;
}
bool stor_write(size_t block)
{
return true;
}