diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2017-08-19 16:51:00 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2017-08-19 16:51:00 +0200 |
| commit | e778deb2c0c7fa2ce2d605dde7a5fe86a686e078 (patch) | |
| tree | 90684cd779d13b5e490a8289e8770ba999da00e5 /Source/PltParser.c | |
| parent | b1aad213d450beae9920e30d6534680474f8df6f (diff) | |
| download | airport-e778deb2c0c7fa2ce2d605dde7a5fe86a686e078.tar.gz | |
* (Bugfix): ptrPlayer->SelectedAircraft was not being updated correctly when new aircraft appeared.
* (Bugfix): PltParser was casting remaining time to uint8_t instead of uint16_t.
* Reduced file buffer size to original value.
* GfxDrawButton(): L1/R1/L2/R2 text is now printed on top of Lx/Rx button.
* Other minor changes.
Diffstat (limited to 'Source/PltParser.c')
| -rw-r--r-- | Source/PltParser.c | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/Source/PltParser.c b/Source/PltParser.c index 8460314..9427494 100644 --- a/Source/PltParser.c +++ b/Source/PltParser.c @@ -16,23 +16,6 @@ * Structs and enums * * *************************************/ -enum -{ - DEPARTURE_ARRIVAL_INDEX = 0, - FLIGHT_NUMBER_INDEX, - PASSENGERS_INDEX, - HOURS_MINUTES_INDEX, - PARKING_INDEX, - REMAINING_TIME_INDEX -}; - -enum -{ - PLT_HOUR_MINUTE_CHARACTERS = 2, - PLT_FIRST_LINE_CHARACTERS = 5, - PLT_COLON_POSITION = 2 -}; - /* ************************************* * Local Variables * *************************************/ @@ -44,6 +27,23 @@ static void PltParserResetBuffers(TYPE_FLIGHT_DATA* ptrFlightData); bool PltParserLoadFile(char* strPath, TYPE_FLIGHT_DATA* ptrFlightData) { + enum + { + DEPARTURE_ARRIVAL_INDEX = 0, + FLIGHT_NUMBER_INDEX, + PASSENGERS_INDEX, + HOURS_MINUTES_INDEX, + PARKING_INDEX, + REMAINING_TIME_INDEX + }; + + enum + { + PLT_HOUR_MINUTE_CHARACTERS = 2, + PLT_FIRST_LINE_CHARACTERS = 5, + PLT_COLON_POSITION = 2 + }; + uint8_t i; uint8_t j; uint8_t aircraftIndex; @@ -136,16 +136,6 @@ bool PltParserLoadFile(char* strPath, TYPE_FLIGHT_DATA* ptrFlightData) while(lineBufferPtr != NULL) { - /* - * enum - { - DEPARTURE_ARRIVAL_INDEX = 0, - FLIGHT_NUMBER_INDEX, - PASSENGERS_INDEX, - HOURS_MINUTES_INDEX, - PARKING_INDEX, - REMAINING_TIME_INDEX - };*/ switch(i) { case DEPARTURE_ARRIVAL_INDEX: @@ -212,7 +202,7 @@ bool PltParserLoadFile(char* strPath, TYPE_FLIGHT_DATA* ptrFlightData) break; case REMAINING_TIME_INDEX: - ptrFlightData->RemainingTime[aircraftIndex] = (uint8_t)atoi(lineBufferPtr); + ptrFlightData->RemainingTime[aircraftIndex] = (uint16_t)atoi(lineBufferPtr); Serial_printf("ptrFlightData->RemainingTime[%d] = %d\n", aircraftIndex, ptrFlightData->RemainingTime[aircraftIndex]); break; |
