acsim_mios_c
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
acsim_mios_c [2007/01/17 00:23] – improved MIOS_IIC for SpeakJet debugging audiocommander | acsim_mios_c [2007/11/17 16:46] (current) – move acsim.zip to "acsim" namespace smashtv | ||
---|---|---|---|
Line 3: | Line 3: | ||
[[acsim_console_h|ACSim_console.h]]\\ | [[acsim_console_h|ACSim_console.h]]\\ | ||
[[acsim_console_c|ACSim_console.c]]\\ | [[acsim_console_c|ACSim_console.c]]\\ | ||
- | |||
- | [[acsim_toolbox_h|ACSim_toolbox.h]]\\ | ||
- | [[acsim_toolbox_c|ACSim_toolbox.c]]\\ | ||
[[acsim_mios_h|ACSim_mios.h]]\\ | [[acsim_mios_h|ACSim_mios.h]]\\ | ||
**[[acsim_mios_c|ACSim_mios.c]]**\\ | **[[acsim_mios_c|ACSim_mios.c]]**\\ | ||
+ | [[acsim_toolbox_h|ACSim_toolbox.h]]\\ | ||
+ | [[acsim_toolbox_c|ACSim_toolbox.c]]\\ | ||
+ | [[acmididefines|ACMidiDefines.h]]\\ | ||
+ | \\ | ||
+ | This code is for viewing only and may not be up to date. You can download the files in a zip file {{acsim: | ||
+ | \\ | ||
\\ | \\ | ||
<code c> | <code c> | ||
/* | /* | ||
| | ||
- | | + | |
* | * | ||
| | ||
Line 36: | Line 39: | ||
#import < | #import < | ||
+ | #import " | ||
#import " | #import " | ||
- | |||
#import " | #import " | ||
Line 44: | Line 47: | ||
#pragma mark Globals | #pragma mark Globals | ||
// globals | // globals | ||
+ | debug_user_timer_t debug_user_timer; | ||
+ | |||
unsigned char debug_ain_lastPin; | unsigned char debug_ain_lastPin; | ||
unsigned int debug_ain_value[32]; | unsigned int debug_ain_value[32]; | ||
Line 50: | Line 55: | ||
unsigned int debug_enc_value[32]; | unsigned int debug_enc_value[32]; | ||
+ | unsigned int debug_MIDI_byteNum = 0; | ||
unsigned int debug_IIC_byteNum = 0; | unsigned int debug_IIC_byteNum = 0; | ||
Line 58: | Line 64: | ||
__PORTCbits_t PORTCbits; | __PORTCbits_t PORTCbits; | ||
__PORTDbits_t PORTDbits; | __PORTDbits_t PORTDbits; | ||
+ | __INTCONbits_t INTCONbits; | ||
mios_box_stat_t MIOS_BOX_STAT; | mios_box_stat_t MIOS_BOX_STAT; | ||
// HLP | // HLP | ||
Line 241: | Line 248: | ||
#pragma mark MIOS_MIDI | #pragma mark MIOS_MIDI | ||
// MIOS_MIDI | // MIOS_MIDI | ||
- | extern void MIOS_MIDI_BeginStream(void) { printf(" | + | extern void MIOS_MIDI_BeginStream(void) { |
- | extern void MIOS_MIDI_TxBufferPut(unsigned char b) { printf(" | + | printf(" |
+ | debug_MIDI_byteNum = 0; | ||
+ | } | ||
+ | extern void MIOS_MIDI_TxBufferPut(unsigned char b) { | ||
+ | unsigned char ch; | ||
+ | printf(" | ||
+ | debug_MIDI_byteNum++; | ||
+ | #if DEBUG_MIDI_VERBOSE | ||
+ | switch(debug_MIDI_byteNum) { | ||
+ | case 1: | ||
+ | // Channel Voice | ||
+ | ch = (b & 0x0f) + 1; | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | // System Common | ||
+ | if( (b==MIDI_SYSEX) ) { printf(" | ||
+ | if( (b==MIDI_TIMECODE) ) { printf(" | ||
+ | if( (b==MIDI_SONG_POSITION_POINTER) ) { printf(" | ||
+ | if( (b==MIDI_SONG_SELECT) ) { printf(" | ||
+ | if( (b==MIDI_TUNE_REQUEST) ) { printf(" | ||
+ | if( (b==MIDI_EOX) ) { printf(" | ||
+ | // System Realtime | ||
+ | if( (b==MIDI_CLOCK) ) { printf(" | ||
+ | if( (b==MIDI_START) ) { printf(" | ||
+ | if( (b==MIDI_CONTINUE) ) { printf(" | ||
+ | if( (b==MIDI_STOP) ) { printf(" | ||
+ | if( (b==MIDI_ACTIVE_SENSING) ) { printf(" | ||
+ | if( (b==MIDI_RESET) ) { printf(" | ||
+ | break; | ||
+ | case 2: | ||
+ | case 3: | ||
+ | printf(" | ||
+ | break; | ||
+ | } | ||
+ | // reset counter for System Realtime Bytes | ||
+ | if(b >= MIDI_CLOCK) { debug_MIDI_byteNum = 0; } | ||
+ | #endif | ||
+ | } | ||
extern void MIOS_MIDI_EndStream(void) { | extern void MIOS_MIDI_EndStream(void) { | ||
+ | debug_MIDI_byteNum = 0; | ||
printf(" | printf(" | ||
- | DISPLAY_Init(); | ||
} | } | ||
+ | extern unsigned char MIOS_MIDI_MergerGet(void) { return 0; } // not yet supported! | ||
+ | extern void MIOS_MIDI_MergerSet(unsigned char mode) { return; } // not yet supported! | ||
+ | |||
+ | /* | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | */ | ||
#pragma mark MIOS_TIMER | #pragma mark MIOS_TIMER | ||
// MIOS_TIMER | // MIOS_TIMER | ||
- | extern void MIOS_TIMER_Init(unsigned char mode, unsigned int period) { return; } | + | extern void MIOS_TIMER_Init(unsigned char mode, unsigned int period) { |
+ | debug_user_timer.TIMER_ENABLED = TRUE; | ||
+ | return; | ||
+ | } | ||
extern void MIOS_TIMER_Start(void) { return; } | extern void MIOS_TIMER_Start(void) { return; } | ||
- | extern void MIOS_TIMER_Stop(void) { return; } | + | extern void MIOS_TIMER_Stop(void) { |
- | extern void MIOS_TIMER_ReInit(unsigned char mode, unsigned int period) { return; } | + | debug_user_timer.TIMER_ENABLED = FALSE; |
+ | return; | ||
+ | } | ||
+ | extern void MIOS_TIMER_ReInit(unsigned char mode, unsigned int period) { | ||
+ | MIOS_TIMER_Init(mode, | ||
+ | return; | ||
+ | } | ||
acsim_mios_c.1168993431.txt.gz · Last modified: 2007/01/21 21:28 (external edit)