mirror of
https://github.com/thelsing/knx.git
synced 2025-09-18 17:52:44 +02:00
reduce footprint, save 5 byte
This commit is contained in:
parent
0fb3c704dc
commit
649535d4c4
@ -31,23 +31,25 @@ ApplicationProgramObject::ApplicationProgramObject(Memory& memory)
|
||||
|
||||
uint8_t* ApplicationProgramObject::save(uint8_t* buffer)
|
||||
{
|
||||
property(PID_PROG_VERSION)->read(_programVersion);
|
||||
buffer = pushByteArray(_programVersion, 5, buffer);
|
||||
uint8_t programVersion[5];
|
||||
property(PID_PROG_VERSION)->read(programVersion);
|
||||
buffer = pushByteArray(programVersion, 5, buffer);
|
||||
|
||||
return TableObject::save(buffer);
|
||||
}
|
||||
|
||||
const uint8_t* ApplicationProgramObject::restore(const uint8_t* buffer)
|
||||
{
|
||||
buffer = popByteArray(_programVersion, 5, buffer);
|
||||
property(PID_PROG_VERSION)->write(_programVersion);
|
||||
uint8_t programVersion[5];
|
||||
buffer = popByteArray(programVersion, 5, buffer);
|
||||
property(PID_PROG_VERSION)->write(programVersion);
|
||||
|
||||
return TableObject::restore(buffer);
|
||||
}
|
||||
|
||||
uint16_t ApplicationProgramObject::saveSize()
|
||||
{
|
||||
return sizeof(_programVersion) + TableObject::saveSize();
|
||||
return TableObject::saveSize() + 5; // sizeof(programVersion)
|
||||
}
|
||||
|
||||
uint8_t * ApplicationProgramObject::data(uint32_t addr)
|
||||
|
@ -15,7 +15,4 @@ class ApplicationProgramObject : public TableObject
|
||||
uint16_t getWord(uint32_t addr);
|
||||
uint32_t getInt(uint32_t addr);
|
||||
double getFloat(uint32_t addr, ParameterFloatEncodings encoding);
|
||||
|
||||
private:
|
||||
uint8_t _programVersion[5] = { 0, 0, 0, 0, 0};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user