mirror of
https://github.com/thelsing/knx.git
synced 2025-08-31 13:47:01 +02:00
rolled back linux plattform to eeprom
This commit is contained in:
parent
5bf2177d66
commit
dbfd190653
@ -1,15 +1,5 @@
|
||||
#include "linux_platform.h"
|
||||
#ifdef __linux__
|
||||
|
||||
#include "knx/device_object.h"
|
||||
#include "knx/address_table_object.h"
|
||||
#include "knx/association_table_object.h"
|
||||
#include "knx/group_object_table_object.h"
|
||||
#include "knx/application_program_object.h"
|
||||
#include "knx/ip_parameter_object.h"
|
||||
#include "knx/bits.h"
|
||||
#include "knx/ip_host_protocol_address_information.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
@ -38,6 +28,15 @@
|
||||
#include <poll.h> // Needed for GPIO edge detection
|
||||
#include <sys/time.h> // Needed for delayMicroseconds()
|
||||
|
||||
#include "knx/device_object.h"
|
||||
#include "knx/address_table_object.h"
|
||||
#include "knx/association_table_object.h"
|
||||
#include "knx/group_object_table_object.h"
|
||||
#include "knx/application_program_object.h"
|
||||
#include "knx/ip_parameter_object.h"
|
||||
#include "knx/bits.h"
|
||||
#include "knx/ip_host_protocol_address_information.h"
|
||||
|
||||
#define MAX_MEM 4096
|
||||
|
||||
LinuxPlatform::LinuxPlatform()
|
||||
@ -266,15 +265,15 @@ int LinuxPlatform::readBytesMultiCast(uint8_t* buffer, uint16_t maxLen)
|
||||
return len;
|
||||
}
|
||||
|
||||
uint8_t* LinuxPlatform::getNonVolatileMemoryStart()
|
||||
uint8_t* LinuxPlatform::getEepromBuffer(uint16_t size)
|
||||
{
|
||||
if (_fd < 0)
|
||||
doMemoryMapping();
|
||||
|
||||
return _mappedFile;
|
||||
return _mappedFile + 2;
|
||||
}
|
||||
|
||||
void LinuxPlatform::commitNonVolatileMemory()
|
||||
void LinuxPlatform::commitToEeprom()
|
||||
{
|
||||
if (_fd < 0)
|
||||
doMemoryMapping();
|
||||
@ -314,6 +313,8 @@ void LinuxPlatform::doMemoryMapping()
|
||||
if (addr[0] != 0xAF || addr[1] != 0xFE)
|
||||
{
|
||||
memset(addr, 0, FLASHSIZE);
|
||||
addr[0] = 0xAF;
|
||||
addr[1] = 0xFE;
|
||||
}
|
||||
|
||||
if (addr == MAP_FAILED)
|
||||
|
@ -55,8 +55,8 @@ public:
|
||||
int readWriteSpi (uint8_t *data, size_t len) override;
|
||||
|
||||
//memory
|
||||
uint8_t* getNonVolatileMemoryStart() override;
|
||||
void commitNonVolatileMemory() override;
|
||||
uint8_t* getEepromBuffer(uint16_t size) override;
|
||||
void commitToEeprom() override;
|
||||
void cmdlineArgs(int argc, char** argv);
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user