1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-16 07:23:07 +01:00

add some memory diagnostics

This commit is contained in:
andreas
2021-10-30 12:01:50 +02:00
parent 56aaf595b4
commit e7b2c6e756
14 changed files with 54 additions and 20 deletions

View File

@@ -51,6 +51,7 @@ const char Prefix='!';
std::vector<ship *> vships;
int numShips(){return vships.size();}
// ************************ Helper for AIS ***********************************
static bool AddMessageType(tNMEA0183AISMsg &NMEA0183AISMsg, uint8_t MessageType);
static bool AddRepeat(tNMEA0183AISMsg &NMEA0183AISMsg, uint8_t Repeat);
@@ -250,7 +251,9 @@ bool SetAISClassBMessage24(tNMEA0183AISMsg &NMEA0183AISMsg, uint8_t MessageID,
}
}
if ( i > MAX_SHIP_IN_VECTOR ) {
vships.erase(vships.begin());
std::vector<ship *>::iterator it=vships.begin();
delete *it;
vships.erase(it);
}
// AIS Type 24 Message