Skip to content

Commit

Permalink
added recording LED config and code
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetlilmre committed Jun 5, 2015
1 parent d4f9d1a commit 344bf4b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
6 changes: 6 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
#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 REC_LED_PORT PORTD
#define REC_LED_DDR DDRD
#define REC_LED_PIN 2
#define REC_LED_OFF() REC_LED_PORT |= _BV(REC_LED_PIN)
#define REC_LED_ON() REC_LED_PORT &= ~_BV(REC_LED_PIN)

// comment this line if you are using HW1.0
#define KEYS_INPUT_PULLUP
#define KEYS_READ_PORT PORTC
Expand Down
17 changes: 12 additions & 5 deletions tapuino.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ void record_file(char* pfile_name) {
lcd_busy_spinner();
return;
}

REC_LED_ON();

lcd_title_P(S_RECORDING);
lcd_status(pfile_name);

Expand All @@ -506,11 +509,11 @@ void record_file(char* pfile_name) {
uint32_t* buffer_magic = (uint32_t*) g_fat_buffer;
//set appropriate header informations for C64 or C16
if (g_machine_type == C16) {
buffer_magic[0] = TAP_MAGIC_C16;
g_fat_buffer[13] = C16;
buffer_magic[0] = TAP_MAGIC_C16;
g_fat_buffer[13] = C16;
} else {
buffer_magic[0] = TAP_MAGIC_C64;
g_fat_buffer[13] = C64;
buffer_magic[0] = TAP_MAGIC_C64;
g_fat_buffer[13] = C64;
}
buffer_magic[1] = TAP_MAGIC_POSTFIX1; // copy the magic to the buffer: "TAPE"
buffer_magic[2] = TAP_MAGIC_POSTFIX2; // copy the magic to the buffer: "-RAW"
Expand Down Expand Up @@ -590,7 +593,7 @@ void record_file(char* pfile_name) {

// end of load UI indicator
lcd_busy_spinner();

REC_LED_OFF();
}

/*
Expand Down Expand Up @@ -667,6 +670,10 @@ int tapuino_hardware_setup(void)
// default both LOW so BUS 0
CONTROL_SET_BUS0();

// recording led (Arduino: D2, Atmel: PD2)
REC_LED_DDR |= _BV(REC_LED_PIN);
REC_LED_OFF();

// keys are all inputs, activate pullups
KEYS_READ_DDR &= ~_BV(KEY_SELECT_PIN);
KEYS_READ_PORT |= _BV(KEY_SELECT_PIN);
Expand Down

0 comments on commit 344bf4b

Please sign in to comment.