You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
546 B

// 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;
}