소스 검색

Fixed maxEntryIndex being set to 6 as eeprom is not initialized on static init.

tags/v1.2.0
Bertrand Lemasle 7 년 전
부모
커밋
838c2c3b62
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. +2
    -1
      GpsTracker/Positions.cpp

+ 2
- 1
GpsTracker/Positions.cpp 파일 보기

@@ -26,7 +26,7 @@ namespace positions {
#endif

namespace details {
uint16_t maxEntryIndex = (E24_MAX_ADDRESS(hardware::i2c::eeprom.getSize()) - ENTRIES_ADDR) / ENTRY_RESERVED_SIZE;
uint16_t maxEntryIndex = 0;

uint16_t getEntryAddress(uint16_t index) {
if (index > maxEntryIndex) return -1;
@@ -35,6 +35,7 @@ namespace positions {
}

void setup() {
details::maxEntryIndex = (E24_MAX_ADDRESS(hardware::i2c::eeprom.getSize()) - ENTRIES_ADDR) / ENTRY_RESERVED_SIZE;
#ifdef BACKUPS_ENABLED
uint8_t backupIdx = 0;
_backups = new backup::PositionsBackup*[BACKUPS_ENABLED];


불러오는 중...
취소
저장