Commit 3a41a4df authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added a module to simulate the AVR EEPROM. Needed for the new Dynamixel slave...

Added a module to simulate the AVR EEPROM. Needed for the new Dynamixel slave interface of the firmware.
parent 4ccc17a8
......@@ -129,7 +129,9 @@ add_library(${PROJECT_NAME} src/bioloid_controller_cm510.cpp
${BIOLOID_FW_PATH}/controllers/src/buzzer.c
# communications modules
${BIOLOID_FW_PATH}/communications/src/dynamixel.c
${BIOLOID_FW_PATH}/communications/src/memory.c
# main application module
# ${ProjectPath}/cm510_vision.c
${ProjectPath}/stairs.c
# AVR simulation modules
src/sim/avr_delay.c
......
#ifndef _AVR_EEPROM_H
#define _AVR_EEPROM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <avr/io.h>
uint8_t eeprom_read_byte(const uint8_t *p);
void eeprom_write_byte(uint8_t *p, uint8_t value);
#ifdef __cplusplus
}
#endif
#endif
#include "memory.h"
#define EEPROM_BASE 0x00810000
uint8_t eeprom_mem[2*EEPROM_SIZE]={0xFF};
uint8_t eeprom_read_byte(const uint8_t *p)
{
return eeprom_mem[(int)(p-EEPROM_BASE)];
}
void eeprom_write_byte(uint8_t *p, uint8_t value)
{
eeprom_mem[(int)(p-EEPROM_BASE)]=value;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment