Fake input and bug fixes
* Press W in simulator to activate (pretty slow shit, do avoid unless compiling with optimisations) * Tiny improvement of the EEPROM simulation. * Fixed type typo for millis and micros
This commit is contained in:
parent
266b3334cb
commit
1be998153a
6 changed files with 58 additions and 45 deletions
|
|
@ -1,26 +1,32 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
#include "EEPROM.h"
|
||||
|
||||
// TODO: Fake eeprom a bit better, maybe even save to file.
|
||||
|
||||
static char someFakeEEPROM_memory[4096];
|
||||
EEPROMClass::EEPROMClass() {
|
||||
memset(someFakeEEPROM_memory, 0xff, sizeof(someFakeEEPROM_memory));
|
||||
}
|
||||
|
||||
|
||||
uint8_t EEPROMClass::read( int idx )
|
||||
{
|
||||
printf("Reading EEPROM address %d: %d\n", idx, someFakeEEPROM_memory[idx]);
|
||||
return someFakeEEPROM_memory[idx];
|
||||
}
|
||||
|
||||
|
||||
void EEPROMClass::write( int idx, uint8_t val )
|
||||
{
|
||||
printf("Writing to EEPROM address %d = %d\n", idx, val);
|
||||
someFakeEEPROM_memory[idx] = val;
|
||||
}
|
||||
|
||||
void EEPROMClass::update( int idx, uint8_t val )
|
||||
{
|
||||
someFakeEEPROM_memory[idx] = val;
|
||||
write(idx, val);
|
||||
}
|
||||
uint16_t EEPROMClass::length()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue