mirror of
				https://github.com/thelsing/knx.git
				synced 2025-10-26 10:26:25 +01:00 
			
		
		
		
	16 bit for blocksize should be enough
This commit is contained in:
		
							parent
							
								
									07133807d8
								
							
						
					
					
						commit
						d3cb967216
					
				@ -44,8 +44,8 @@ void Memory::readMemory()
 | 
				
			|||||||
        TableObject* tableObject = dynamic_cast<TableObject*>(_saveRestores[i]);
 | 
					        TableObject* tableObject = dynamic_cast<TableObject*>(_saveRestores[i]);
 | 
				
			||||||
        if (tableObject)
 | 
					        if (tableObject)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            uint32_t memorySize = 0;
 | 
					            uint16_t memorySize = 0;
 | 
				
			||||||
            buffer = popInt(memorySize, buffer);
 | 
					            buffer = popWord(memorySize, buffer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // this works because TableObject saves a relative addr and restores it itself
 | 
					            // this works because TableObject saves a relative addr and restores it itself
 | 
				
			||||||
            addNewUsedBlock(tableObject->_data, memorySize);
 | 
					            addNewUsedBlock(tableObject->_data, memorySize);
 | 
				
			||||||
@ -75,7 +75,7 @@ void Memory::writeMemory()
 | 
				
			|||||||
                println("_data of TableObject not in errorlist");
 | 
					                println("_data of TableObject not in errorlist");
 | 
				
			||||||
                _platform.fatalError();
 | 
					                _platform.fatalError();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            buffer = pushInt(block->size, buffer);
 | 
					            buffer = pushWord(block->size, buffer);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    _platform.commitToEeprom();
 | 
					    _platform.commitToEeprom();
 | 
				
			||||||
@ -89,6 +89,12 @@ void Memory::addSaveRestore(SaveRestore* obj)
 | 
				
			|||||||
    _saveRestores[_saveCount] = obj;
 | 
					    _saveRestores[_saveCount] = obj;
 | 
				
			||||||
    _saveCount += 1;
 | 
					    _saveCount += 1;
 | 
				
			||||||
    _metadataSize += obj->saveSize();
 | 
					    _metadataSize += obj->saveSize();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    TableObject* tableObject = dynamic_cast<TableObject*>(obj);
 | 
				
			||||||
 | 
					    if (tableObject)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        _metadataSize += 2; //
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user