Skip to content

Commit

Permalink
Fixed Platformio version to 4.1.0 to avoid 4.2.0 broken timer behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetlilmre committed May 5, 2022
1 parent a151ad9 commit 12308c0
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 21 deletions.
24 changes: 19 additions & 5 deletions include/SharedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,33 @@ namespace TapuinoNext
{
extern const char* machineTypeNames[];

/*
TODO: Vice has definitions for other machine types
PET 3
C500 4
C600 5
*/

enum class MACHINE_TYPE : uint8_t
{
C64,
VIC,
C16
C64 = 0,
VIC = 1,
C16 = 2
};

extern const char* videoModeNames[];

/*
TODO: Vice has definitions for other video types
NTSCOLD 2
PALN 3
*/

enum class VIDEO_MODE : uint8_t
{
PAL,
NSTC
PAL = 0,
NSTC = 1
};

} // namespace TapuinoNext
4 changes: 4 additions & 0 deletions include/TapBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ namespace TapuinoNext
#define TAP_HEADER_MAGIC_LENGTH 12
#define TAP_HEADER_DATA_LENGTH 8

#define TAP_HEADER_VERSION_0 0
#define TAP_HEADER_VERSION_1 1
#define TAP_HEADER_VERSION_2 2

struct TAP_INFO
{
uint8_t version; // TAP file format version:
Expand Down
6 changes: 3 additions & 3 deletions include/Version.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

#ifndef FW_BUILD_NUMBER
#define FW_BUILD_NUMBER "122"
#define FW_BUILD_NUMBER "148"
#endif
#ifndef FW_VERSION
#define FW_VERSION "0.0.1-alpha+122"
#define FW_VERSION "0.0.1-alpha+148"
#endif
#ifndef FW_BUILD_TIME
#define FW_BUILD_TIME "2022-05-03 19:25:30.032250"
#define FW_BUILD_TIME "2022-05-05 10:21:50.472416"
#endif

2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html

[env:esp32dev]
platform = espressif32
platform = https://github.com/platformio/platform-espressif32.git#v4.1.0
board = esp32dev
framework = arduino
monitor_speed = 115200
Expand Down
2 changes: 1 addition & 1 deletion src/LCDUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void LCDUtils::PlayUI(bool motor, uint16_t counter, uint32_t tickerTime)
memset(buf, 32, 8);

lcd->SetCursor(I2C_DISP_COLS - 6, 0);
snprintf(buf, 7, "%03d %c%c", counter, motor ? 'M' : 'm', Spinner());
snprintf(buf, 7, "%03u %c%c", counter % 1000u, motor ? 'M' : 'm', Spinner());
lcd->Print(buf);
}

Expand Down
19 changes: 9 additions & 10 deletions src/TapRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ void TapRecorder::CalcTapData(uint32_t signalTime)
}
else
{
// in version 0 TAP files a zero is used to indicate an overflow condition
// Only TAP version 1 files are supported.
// TODO: implement Version 2 (C16 half-wave)
// TAP version 0 will NOT be supported

WriteByte(0);
// otherwise the zero is followed by 24 bits of signal data
if (tapInfo.version != 0)
{
uint32_t tapData = (uint32_t) ((double) signalTime / cycleMultRaw);
WriteByte((uint8_t) tapData);
WriteByte((uint8_t) (tapData >> 8));
WriteByte((uint8_t) (tapData >> 16));
}
uint32_t tapData = (uint32_t) ((double) signalTime / cycleMultRaw);
WriteByte((uint8_t) tapData);
WriteByte((uint8_t) (tapData >> 8));
WriteByte((uint8_t) (tapData >> 16));
}
}

Expand Down Expand Up @@ -129,7 +128,7 @@ ErrorCodes TapRecorder::CreateTap(File tapFile)
tap_magic[1] = TAP_MAGIC_POSTFIX1;
tap_magic[2] = TAP_MAGIC_POSTFIX2;

tapInfo.version = machineType == MACHINE_TYPE::C16 ? 2 : 1;
tapInfo.version = machineType == MACHINE_TYPE::C16 ? TAP_HEADER_VERSION_2 : TAP_HEADER_VERSION_1;
tapInfo.video = (uint8_t) (options->ntscPAL.GetValue() ? VIDEO_MODE::NSTC : VIDEO_MODE::PAL);
tapInfo.platform = (uint8_t) machineType;

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1-alpha+122
0.0.1-alpha+148

0 comments on commit 12308c0

Please sign in to comment.