diff --git a/Tapuino.cproj b/Tapuino.cproj new file mode 100644 index 0000000..7bc87d2 --- /dev/null +++ b/Tapuino.cproj @@ -0,0 +1,195 @@ + + + + 2.0 + 6.2 + com.Atmel.AVRGCC8.C + {4ec26722-9e4b-4e84-94fb-ac9f2dab1ef2} + ATmega328P + none + Executable + C + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + Tapuino + Tapuino + Tapuino + Native + true + false + true + true + + + + 2 + 1 + + + + + + + + + + + + + + + + + True + True + True + True + False + True + True + + + NDEBUG + F_CPU=16000000 + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + + + + + True + True + True + True + False + True + True + + + DEBUG + F_CPU=16000000 + + + Optimize (-O1) + True + True + Default (-g2) + True + + + libm + + + Default (-Wa,-g) + + + + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + + \ No newline at end of file diff --git a/config.h b/config.h index 3329296..9d8c392 100644 --- a/config.h +++ b/config.h @@ -55,8 +55,10 @@ #define CONTROL_PORT PORTD #define CONTROL_DDR DDRD -#define CONTROL_PIN1 6 -#define CONTROL_PIN2 7 +#define CONTROL_PIN0 6 +#define CONTROL_PIN1 7 +#define CONTROL_SET_BUS0() CONTROL_PORT &= ~(_BV(CONTROL_PIN0) | _BV(CONTROL_PIN1)) +#define CONTROL_SET_BUS1() { CONTROL_PORT &= ~_BV(CONTROL_PIN1); CONTROL_PORT |= _BV(CONTROL_PIN0); } #define KEYS_READ_PORT PORTC #define KEYS_READ_DDR DDRC diff --git a/layout/tapuino-main-bottom-r2.png b/layout/tapuino-main-bottom-r2.png new file mode 100644 index 0000000..89fc508 Binary files /dev/null and b/layout/tapuino-main-bottom-r2.png differ diff --git a/layout/tapuino-main-r2.png b/layout/tapuino-main-r2.png new file mode 100644 index 0000000..2625f84 Binary files /dev/null and b/layout/tapuino-main-r2.png differ diff --git a/layout/tapuino-mux-board-r2-bottom.png b/layout/tapuino-mux-board-r2-bottom.png new file mode 100644 index 0000000..825d5f4 Binary files /dev/null and b/layout/tapuino-mux-board-r2-bottom.png differ diff --git a/layout/tapuino-mux-board-r2.png b/layout/tapuino-mux-board-r2.png new file mode 100644 index 0000000..46e68f7 Binary files /dev/null and b/layout/tapuino-mux-board-r2.png differ diff --git a/layout/tapuino.fzz b/layout/tapuino.fzz index 7316438..3dc1013 100644 Binary files a/layout/tapuino.fzz and b/layout/tapuino.fzz differ diff --git a/layout/tapuino_bb.png b/layout/tapuino_bb.png index 1419bee..6db819b 100644 Binary files a/layout/tapuino_bb.png and b/layout/tapuino_bb.png differ diff --git a/main.c b/main.c new file mode 100644 index 0000000..a6e1c37 --- /dev/null +++ b/main.c @@ -0,0 +1,22 @@ +/* + * Tapuino.c + * + * Created: 2014/10/04 04:31:40 PM + * Author: sweetlilmre + */ + +#ifndef ARDUINO + +#include +#include "tapuino.h" + +int main(void) +{ + while(1) + { + tapuino_run(); + //TODO:: Please write your application code + } +} + +#endif diff --git a/memstrings.c b/memstrings.c index d54e225..7e4b425 100644 --- a/memstrings.c +++ b/memstrings.c @@ -1,42 +1,42 @@ #include #include "memstrings.h" -prog_char S_DEFAULT_RECORD_DIR[] PROGMEM = "/recorded"; -prog_char S_NAME_PATTERN[] PROGMEM = "rec-%.4d.tap"; -prog_char S_RECORDING[] PROGMEM = "Recording"; -prog_char S_SELECT_RECORD_MODE[] PROGMEM = "Name mode:"; -prog_char S_REC_MODE_MANUAL[] PROGMEM = "Manual"; -prog_char S_REC_MODE_AUTO[] PROGMEM = "Auto"; -prog_char S_ENTER_FILENAME[] PROGMEM = "Enter name"; -prog_char S_FILENAME_CHARS[] PROGMEM = " abcdefghijklmnopqrstuvwxyz0123456789_-"; +const char S_DEFAULT_RECORD_DIR[] PROGMEM = "/recorded"; +const char S_NAME_PATTERN[] PROGMEM = "rec-%.4d.tap"; +const char S_RECORDING[] PROGMEM = "Recording"; +const char S_SELECT_RECORD_MODE[] PROGMEM = "Name mode:"; +const char S_REC_MODE_MANUAL[] PROGMEM = "Manual"; +const char S_REC_MODE_AUTO[] PROGMEM = "Auto"; +const char S_ENTER_FILENAME[] PROGMEM = "Enter name"; +const char S_FILENAME_CHARS[] PROGMEM = " abcdefghijklmnopqrstuvwxyz0123456789_-"; -prog_char S_INIT[] PROGMEM = "Init..."; -prog_char S_INIT_FAILED[] PROGMEM = "Init failed!"; -prog_char S_INIT_OK[] PROGMEM = "Init OK."; +const char S_INIT[] PROGMEM = "Init..."; +const char S_INIT_FAILED[] PROGMEM = "Init failed!"; +const char S_INIT_OK[] PROGMEM = "Init OK."; -prog_char S_NO_FILES_FOUND[] PROGMEM = "No files found!"; -prog_char S_SELECT_FILE[] PROGMEM = "Select file:"; -prog_char S_SELECT_MODE[] PROGMEM = "Select mode:"; -prog_char S_MODE_PLAY[] PROGMEM = "Play"; -prog_char S_MODE_RECORD[] PROGMEM = "Record"; -prog_char S_READY_RECORD[] PROGMEM = "Ready..."; -prog_char S_PRESS_START[] PROGMEM = "Press START"; +const char S_NO_FILES_FOUND[] PROGMEM = "No files found!"; +const char S_SELECT_FILE[] PROGMEM = "Select file:"; +const char S_SELECT_MODE[] PROGMEM = "Select mode:"; +const char S_MODE_PLAY[] PROGMEM = "Play"; +const char S_MODE_RECORD[] PROGMEM = "Record"; +const char S_READY_RECORD[] PROGMEM = "Ready..."; +const char S_PRESS_START[] PROGMEM = "Press START"; -prog_char S_MODE_OPTIONS[] PROGMEM = "Options"; -prog_char S_OPTION_SIGNAL[] PROGMEM = "Invert"; -prog_char S_OPTION_KEY_REPEAT[] PROGMEM = "Key speed"; -prog_char S_OPTION_TICKER_SPEED[] PROGMEM = "Ticker speed"; -prog_char S_OPTION_TICKER_HOLD[] PROGMEM = "Ticker hold"; -prog_char S_OPTION_REC_FINALIZE[] PROGMEM = "Record finalize"; +const char S_MODE_OPTIONS[] PROGMEM = "Options"; +const char S_OPTION_SIGNAL[] PROGMEM = "Invert"; +const char S_OPTION_KEY_REPEAT[] PROGMEM = "Key speed"; +const char S_OPTION_TICKER_SPEED[] PROGMEM = "Ticker speed"; +const char S_OPTION_TICKER_HOLD[] PROGMEM = "Ticker hold"; +const char S_OPTION_REC_FINALIZE[] PROGMEM = "Record finalize"; -prog_char S_MKDIR_FAILED[] PROGMEM = "MKDIR fail!"; -prog_char S_CHDIR_FAILED[] PROGMEM = "CHDIR fail!"; -prog_char S_READ_FAILED[] PROGMEM = "READ fail!"; -prog_char S_OPEN_FAILED[] PROGMEM = "OPEN fail!"; -prog_char S_INVALID_TAP[] PROGMEM = "Invalid TAP!"; +const char S_MKDIR_FAILED[] PROGMEM = "MKDIR fail!"; +const char S_CHDIR_FAILED[] PROGMEM = "CHDIR fail!"; +const char S_READ_FAILED[] PROGMEM = "READ fail!"; +const char S_OPEN_FAILED[] PROGMEM = "OPEN fail!"; +const char S_INVALID_TAP[] PROGMEM = "Invalid TAP!"; -prog_char S_LOADING[] PROGMEM = "Loading:"; -prog_char S_OPERATION_COMPLETE[] PROGMEM = "Complete!"; -prog_char S_OPERATION_ABORTED[] PROGMEM = "Aborted!"; +const char S_LOADING[] PROGMEM = "Loading:"; +const char S_OPERATION_COMPLETE[] PROGMEM = "Complete!"; +const char S_OPERATION_ABORTED[] PROGMEM = "Aborted!"; -prog_char S_TAP_MAGIC_C64[] PROGMEM = "C64-TAPE-RAW"; +const char S_TAP_MAGIC_C64[] PROGMEM = "C64-TAPE-RAW"; diff --git a/memstrings.h b/memstrings.h index 1f0f348..072767e 100644 --- a/memstrings.h +++ b/memstrings.h @@ -3,43 +3,43 @@ #include -extern prog_char S_DEFAULT_RECORD_DIR[]; -extern prog_char S_NAME_PATTERN[]; -extern prog_char S_RECORDING[]; -extern prog_char S_SELECT_RECORD_MODE[]; -extern prog_char S_REC_MODE_MANUAL[]; -extern prog_char S_REC_MODE_AUTO[]; -extern prog_char S_ENTER_FILENAME[]; -extern prog_char S_FILENAME_CHARS[]; +extern const char S_DEFAULT_RECORD_DIR[]; +extern const char S_NAME_PATTERN[]; +extern const char S_RECORDING[]; +extern const char S_SELECT_RECORD_MODE[]; +extern const char S_REC_MODE_MANUAL[]; +extern const char S_REC_MODE_AUTO[]; +extern const char S_ENTER_FILENAME[]; +extern const char S_FILENAME_CHARS[]; -extern prog_char S_STARTINGINIT[]; -extern prog_char S_INITI2COK[]; -extern prog_char S_INIT[]; -extern prog_char S_INIT_FAILED[]; -extern prog_char S_INIT_OK[]; -extern prog_char S_NO_FILES_FOUND[]; -extern prog_char S_SELECT_FILE[]; -extern prog_char S_SELECT_MODE[]; -extern prog_char S_MODE_PLAY[]; -extern prog_char S_MODE_RECORD[]; -extern prog_char S_READY_RECORD[]; -extern prog_char S_PRESS_START[]; +extern const char S_STARTINGINIT[]; +extern const char S_INITI2COK[]; +extern const char S_INIT[]; +extern const char S_INIT_FAILED[]; +extern const char S_INIT_OK[]; +extern const char S_NO_FILES_FOUND[]; +extern const char S_SELECT_FILE[]; +extern const char S_SELECT_MODE[]; +extern const char S_MODE_PLAY[]; +extern const char S_MODE_RECORD[]; +extern const char S_READY_RECORD[]; +extern const char S_PRESS_START[]; -extern prog_char S_MODE_OPTIONS[]; -extern prog_char S_OPTION_SIGNAL[]; -extern prog_char S_OPTION_KEY_REPEAT[]; -extern prog_char S_OPTION_TICKER_SPEED[]; -extern prog_char S_OPTION_TICKER_HOLD[]; -extern prog_char S_OPTION_REC_FINALIZE[]; +extern const char S_MODE_OPTIONS[]; +extern const char S_OPTION_SIGNAL[]; +extern const char S_OPTION_KEY_REPEAT[]; +extern const char S_OPTION_TICKER_SPEED[]; +extern const char S_OPTION_TICKER_HOLD[]; +extern const char S_OPTION_REC_FINALIZE[]; -extern prog_char S_MKDIR_FAILED[]; -extern prog_char S_CHDIR_FAILED[]; -extern prog_char S_READ_FAILED[]; -extern prog_char S_OPEN_FAILED[]; -extern prog_char S_INVALID_TAP[]; -extern prog_char S_LOADING[]; -extern prog_char S_OPERATION_COMPLETE[]; -extern prog_char S_OPERATION_ABORTED[]; -extern prog_char S_TAP_MAGIC_C64[]; +extern const char S_MKDIR_FAILED[]; +extern const char S_CHDIR_FAILED[]; +extern const char S_READ_FAILED[]; +extern const char S_OPEN_FAILED[]; +extern const char S_INVALID_TAP[]; +extern const char S_LOADING[]; +extern const char S_OPERATION_COMPLETE[]; +extern const char S_OPERATION_ABORTED[]; +extern const char S_TAP_MAGIC_C64[]; #endif diff --git a/menu.c b/menu.c index 3435561..9e87b5a 100644 --- a/menu.c +++ b/menu.c @@ -337,6 +337,11 @@ void handle_mode_options() { value = g_invert_signal; if (handle_option_value(S_MODE_OPTIONS, S_OPTION_SIGNAL, &value, 0, 1, 1)) { g_invert_signal = value; + if (value) { + CONTROL_SET_BUS1(); + } else { + CONTROL_SET_BUS0(); + } save = 1; } break; diff --git a/tapuino.c b/tapuino.c index ef18ae0..a87ba1d 100644 --- a/tapuino.c +++ b/tapuino.c @@ -506,9 +506,9 @@ int tapuino_hardware_setup(void) MOTOR_PORT |= _BV(MOTOR_PIN); // Control pins are output - CONTROL_DDR |= _BV(CONTROL_PIN1) | _BV(CONTROL_PIN2); - // default both LOW - CONTROL_PORT &= ~(_BV(CONTROL_PIN1) | _BV(CONTROL_PIN2)); + CONTROL_DDR |= _BV(CONTROL_PIN0) | _BV(CONTROL_PIN1); + // default both LOW so BUS 0 + CONTROL_SET_BUS0(); // keys are all inputs, activate pullups KEYS_READ_DDR &= ~_BV(KEY_SELECT_PIN);