trash80 / Ym2149Synth

YM2149F Teensy Synthesizer
GNU General Public License v3.0
94 stars 19 forks source link

Teensy 4.0 support? #2

Open 9bryan opened 2 years ago

9bryan commented 2 years ago

Hello,

I absolutely love this project, but I cannot finish it because it requires a teensy 3.2 and they wont be back on the market for quite some time.

I was wondering if there's any possibility to modify the project to support teensy 4.0 or teensy LC. Both of which are available today.

I noticed pinout differences obviously, and the code won't compile for a teensy 4.0.

I'm quite familiar with platformio but my c++ is not very good. Maybe if it's not too much trouble you might be able to tell me which areas I should start looking at?

If I update the board in the platformio.ini file it throws these errors when building:

Compiling .pio/build/teensy40/src/Ym2149Synth.ino.cpp.o
Ym2149Synth/YM2149.cpp: In member function 'void YM2149Class::begin()':
Ym2149Synth/YM2149.cpp:79:5: error: 'GPIOC_PDOR' was not declared in this scope
     GPIOC_PDOR  = (GPIOC_PDOR & B11111000) | B00000100;
     ^
Ym2149Synth/YM2149.cpp: In member function 'void YM2149Class::write(uint8_t, uint8_t)':
Ym2149Synth/YM2149.cpp:98:5: error: 'GPIOD_PDOR' was not declared in this scope
     GPIOD_PDOR  = (GPIOD_PDOR & B00000000) | (address & 0x0f);
     ^
Ym2149Synth/YM2149.cpp:100:5: error: 'GPIOC_PDOR' was not declared in this scope
     GPIOC_PDOR  = (GPIOC_PDOR & B11111100) | B00000011;
     ^
Compiling .pio/build/teensy40/src/name.c.o
*** [.pio/build/teensy40/src/YM2149.cpp.o] Error 1
9bryan commented 2 years ago

Sorry, just discovering the commit history and see that there might be limited support for Teensy LC although it looks like it may not perform ideally. Still curious about Teensy 4.0 though. Thanks :)