Firmware code question....DINsync / MIDIsync independence?

Discuss mods, hacks, tweaks, etc.

Moderators: altitude, adafruit_support_bill, adafruit, phono, hamburgers

Please be positive and constructive with your questions and comments.
Locked
evilxsystems
 
Posts: 406
Joined: Thu Jul 07, 2005 10:23 pm

Firmware code question....DINsync / MIDIsync independence?

Post by evilxsystems »

I've been trying to get a version of pattern edit mode running in the user function_a slot that is synced to MIDI. For simplicity sake I've been ommitting the DINsync code from my new user mode, however I'm having trouble getting MIDIsync to work. From looking at the code in all the modules, the MIDIsync and DINsync code are rather closely tied and I'm wondering if it is actually possible to update the MIDIsync globals without also updating the DINsync globals? Are they actually independent?

Also is this an ok thing to do:
from pattern_edit.c

Code: Select all

void start_runwrite_mode() {
  //putstring("start runwrite\n\r");
  curr_pattern_index = 0;
  in_runwrite_mode = 1;
  set_led(LED_RS); 
  note_off(0);
if (sync==INTERNAL_SYNC){
      turn_on_tempo();
      while (note_counter & 0x1);  // wait for the tempo interrupt
} else if (sync ==MIDI_SYNC){
      turn_off_tempo();
      while (midi_recv_cmd() != MIDI_START);

}
  play_loaded_pattern = 1;
}
there's a lot of other code I changed but this seems to be the hold up...I get stuck in that while loop waiting for MIDI_START...

I should be sending a midi start message from my external sequencer but is it possible the midi_cmd buffer already has a bunch of messages waiting that I need to parse before I get to MIDI_START?

-jason[/code]

Jonnay
 
Posts: 142
Joined: Thu Jun 02, 2005 12:28 pm

Post by Jonnay »

what state are your interupts in? If they are off, then that while loop whould never reach its escape condition.

evilxsystems
 
Posts: 406
Joined: Thu Jul 07, 2005 10:23 pm

Post by evilxsystems »

well I thought they would be on....

midi_recv_cmd() calls midi_getchar() which stops/starts the interrupt...so I thought it would be ok...maybe I'm wrong?

-jason

Jonnay
 
Posts: 142
Joined: Thu Jun 02, 2005 12:28 pm

Post by Jonnay »

I dunno really.

Locked
Please be positive and constructive with your questions and comments.

Return to “x0xm0dz”