Subversion Repositories svn.mios

Rev

Rev 167 | Rev 286 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
44 tk 1
// $Id: main.c 285 2008-04-23 20:31:07Z tk $
2
/*
3
 * MIOS SDCC Wrapper
4
 *
5
 * ==========================================================================
6
 *
7
 *  Copyright (C) <year>  <name> (<email>)
8
 *  Licensed for personal non-commercial use only.
9
 *  All other rights reserved.
10
 *
11
 * ==========================================================================
12
 */
13
 
167 tk 14
 
15
/////////////////////////////////////////////////////////////////////////////
16
// Include files
17
/////////////////////////////////////////////////////////////////////////////
18
 
155 tk 19
#include <cmios.h>
20
#include <pic18fregs.h>
44 tk 21
 
22
 
23
/////////////////////////////////////////////////////////////////////////////
24
// This function is called by MIOS after startup to initialize the 
25
// application
26
/////////////////////////////////////////////////////////////////////////////
27
void Init(void) __wparam
28
{
29
}
30
 
31
/////////////////////////////////////////////////////////////////////////////
32
// This function is called by MIOS in the mainloop when nothing else is to do
33
/////////////////////////////////////////////////////////////////////////////
34
void Tick(void) __wparam
35
{
36
}
37
 
38
/////////////////////////////////////////////////////////////////////////////
39
// This function is periodically called by MIOS. The frequency has to be
40
// initialized with MIOS_Timer_Set
41
/////////////////////////////////////////////////////////////////////////////
42
void Timer(void) __wparam
43
{
44
}
45
 
46
/////////////////////////////////////////////////////////////////////////////
47
// This function is called by MIOS when the display content should be 
48
// initialized. Thats the case during startup and after a temporary message
49
// has been printed on the screen
50
/////////////////////////////////////////////////////////////////////////////
51
void DISPLAY_Init(void) __wparam
52
{
53
  MIOS_LCD_Clear();
54
  MIOS_LCD_CursorSet(0x00);
55
  MIOS_LCD_PrintCString("Hello World!");
56
}
57
 
58
/////////////////////////////////////////////////////////////////////////////
59
//  This function is called in the mainloop when no temporary message is shown
60
//  on screen. Print the realtime messages here
61
/////////////////////////////////////////////////////////////////////////////
62
void DISPLAY_Tick(void) __wparam
63
{
64
}
65
 
66
/////////////////////////////////////////////////////////////////////////////
67
//  This function is called by MIOS when a complete MIDI event has been received
68
/////////////////////////////////////////////////////////////////////////////
69
void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam
70
{
71
}
72
 
73
/////////////////////////////////////////////////////////////////////////////
74
// This function is called by MIOS when a MIDI event has been received
75
// which has been specified in the MIOS_MPROC_EVENT_TABLE
76
/////////////////////////////////////////////////////////////////////////////
77
void MPROC_NotifyFoundEvent(unsigned entry, unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam
78
{
79
}
80
 
81
/////////////////////////////////////////////////////////////////////////////
82
// This function is called by MIOS when a MIDI event has not been completly
83
// received within 2 seconds
84
/////////////////////////////////////////////////////////////////////////////
85
void MPROC_NotifyTimeout(void) __wparam
86
{
87
}
88
 
89
/////////////////////////////////////////////////////////////////////////////
90
// This function is called by MIOS when a MIDI byte has been received
91
/////////////////////////////////////////////////////////////////////////////
92
void MPROC_NotifyReceivedByte(unsigned char byte) __wparam
93
{
94
}
95
 
96
/////////////////////////////////////////////////////////////////////////////
97
// This function is called by MIOS before the shift register are loaded
98
/////////////////////////////////////////////////////////////////////////////
99
void SR_Service_Prepare(void) __wparam
100
{
101
}
102
 
103
/////////////////////////////////////////////////////////////////////////////
104
// This function is called by MIOS after the shift register have been loaded
105
/////////////////////////////////////////////////////////////////////////////
106
void SR_Service_Finish(void) __wparam
107
{
108
}
109
 
110
/////////////////////////////////////////////////////////////////////////////
111
// This function is called by MIOS when an button has been toggled
112
// pin_value is 1 when button released, and 0 when button pressed
113
/////////////////////////////////////////////////////////////////////////////
114
void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam
115
{
116
}
117
 
118
/////////////////////////////////////////////////////////////////////////////
119
// This function is called by MIOS when an encoder has been moved
120
// incrementer is positive when encoder has been turned clockwise, else
121
// it is negative
122
/////////////////////////////////////////////////////////////////////////////
123
void ENC_NotifyChange(unsigned char encoder, char incrementer) __wparam
124
{
125
}
126
 
127
/////////////////////////////////////////////////////////////////////////////
128
// This function is called by MIOS when a pot has been moved
129
/////////////////////////////////////////////////////////////////////////////
130
void AIN_NotifyChange(unsigned char pin, unsigned int pin_value) __wparam
131
{
132
}
285 tk 133
 
134
void high_isr() __interrupt
135
{
136
 
137
  do {
138
    if( PIR1bits.RCIF ) {
139
      Tick();
140
      continue;
141
    }
142
 
143
    if( PIE1bits.TXIE && PIR1bits.RCIF ) {
144
      Tick();
145
      continue;
146
    }
147
 
148
    return;
149
 
150
  } while( 1 );
151
 
152
}