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"
|
#include "linux_platform.h"
|
||||||
#ifdef __linux__
|
#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 <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -38,6 +28,15 @@
|
|||||||
#include <poll.h> // Needed for GPIO edge detection
|
#include <poll.h> // Needed for GPIO edge detection
|
||||||
#include <sys/time.h> // Needed for delayMicroseconds()
|
#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
|
#define MAX_MEM 4096
|
||||||
|
|
||||||
LinuxPlatform::LinuxPlatform()
|
LinuxPlatform::LinuxPlatform()
|
||||||
@ -266,15 +265,15 @@ int LinuxPlatform::readBytesMultiCast(uint8_t* buffer, uint16_t maxLen)
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* LinuxPlatform::getNonVolatileMemoryStart()
|
uint8_t* LinuxPlatform::getEepromBuffer(uint16_t size)
|
||||||
{
|
{
|
||||||
if (_fd < 0)
|
if (_fd < 0)
|
||||||
doMemoryMapping();
|
doMemoryMapping();
|
||||||
|
|
||||||
return _mappedFile;
|
return _mappedFile + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxPlatform::commitNonVolatileMemory()
|
void LinuxPlatform::commitToEeprom()
|
||||||
{
|
{
|
||||||
if (_fd < 0)
|
if (_fd < 0)
|
||||||
doMemoryMapping();
|
doMemoryMapping();
|
||||||
@ -314,6 +313,8 @@ void LinuxPlatform::doMemoryMapping()
|
|||||||
if (addr[0] != 0xAF || addr[1] != 0xFE)
|
if (addr[0] != 0xAF || addr[1] != 0xFE)
|
||||||
{
|
{
|
||||||
memset(addr, 0, FLASHSIZE);
|
memset(addr, 0, FLASHSIZE);
|
||||||
|
addr[0] = 0xAF;
|
||||||
|
addr[1] = 0xFE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addr == MAP_FAILED)
|
if (addr == MAP_FAILED)
|
||||||
|
@ -55,8 +55,8 @@ public:
|
|||||||
int readWriteSpi (uint8_t *data, size_t len) override;
|
int readWriteSpi (uint8_t *data, size_t len) override;
|
||||||
|
|
||||||
//memory
|
//memory
|
||||||
uint8_t* getNonVolatileMemoryStart() override;
|
uint8_t* getEepromBuffer(uint16_t size) override;
|
||||||
void commitNonVolatileMemory() override;
|
void commitToEeprom() override;
|
||||||
void cmdlineArgs(int argc, char** argv);
|
void cmdlineArgs(int argc, char** argv);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user