Commit fde014118c4541d78c200e39ceec0f6c3b1803f4
1 parent
f0c0dcaa
--no commit message
Showing
71 changed files
with
821 additions
and
6053 deletions
Too many changes to show.
To preserve performance only 49 of 71 files are displayed.
BlinkerLaunchPad/.externalToolBuilders/Blinker LaunchPad Builder.launch deleted
1 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType"> | ||
3 | -<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/> | ||
4 | -<mapAttribute key="org.eclipse.debug.core.environmentVariables"> | ||
5 | -<mapEntry key="PATH" value="${eclipse_home}/msptools/bin${system_property:path.separator}${env_var:PATH}"/> | ||
6 | -</mapAttribute> | ||
7 | -<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> | ||
8 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?><resources><item path="/BlinkerLaunchPad/main.c" type="1"/><item path="/BlinkerLaunchPad/main.out" type="1"/><item path="/BlinkerLaunchPad/makefile" type="1"/><item path="/BlinkerSchema/out/Blinker.h" type="1"/><item path="/BlinkerSchema/schema.ems" type="1"/><item path="/CommonLaunchPad" type="4"/></resources>}"/> | ||
9 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}/msptools/bin/gmake${exe_ext}"/> | ||
10 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/> | ||
11 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="all COMMON=${project_loc:/CommonLaunchPad} SCHEMA=${project_loc:/BlinkerSchema}"/> | ||
12 | -<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> | ||
13 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/> | ||
14 | -</launchConfiguration> |
BlinkerLaunchPad/.externalToolBuilders/Blinker LaunchPad Cleaner.launch deleted
1 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType"> | ||
3 | -<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/> | ||
4 | -<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> | ||
5 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}/msptools/bin/gmake${exe_ext}"/> | ||
6 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="clean"/> | ||
7 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="local-clean COMMON=${project_loc:/CommonLaunchPad}"/> | ||
8 | -<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> | ||
9 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/> | ||
10 | -</launchConfiguration> |
BlinkerLaunchPad/.project deleted
1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
2 | -<projectDescription> | ||
3 | - <name>BlinkerLaunchPad</name> | ||
4 | - <comment></comment> | ||
5 | - <projects> | ||
6 | - <project>BlinkerSchema</project> | ||
7 | - </projects> | ||
8 | - <buildSpec> | ||
9 | - <buildCommand> | ||
10 | - <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> | ||
11 | - <triggers>full,incremental,</triggers> | ||
12 | - <arguments> | ||
13 | - <dictionary> | ||
14 | - <key>LaunchConfigHandle</key> | ||
15 | - <value><project>/.externalToolBuilders/Blinker LaunchPad Builder.launch</value> | ||
16 | - </dictionary> | ||
17 | - </arguments> | ||
18 | - </buildCommand> | ||
19 | - <buildCommand> | ||
20 | - <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> | ||
21 | - <triggers>clean,</triggers> | ||
22 | - <arguments> | ||
23 | - <dictionary> | ||
24 | - <key>LaunchConfigHandle</key> | ||
25 | - <value><project>/.externalToolBuilders/Blinker LaunchPad Cleaner.launch</value> | ||
26 | - </dictionary> | ||
27 | - </arguments> | ||
28 | - </buildCommand> | ||
29 | - </buildSpec> | ||
30 | - <natures> | ||
31 | - <nature>com.emmoco.mcmtooling.example.mcmToolingExampleNature</nature> | ||
32 | - </natures> | ||
33 | -</projectDescription> |
BlinkerLaunchPad/Blinker.obj deleted
No preview for this file type
BlinkerLaunchPad/Log/log.txt deleted
BlinkerLaunchPad/main.c deleted
1 | -/* | ||
2 | - * ============ Platform Configuration ============ | ||
3 | - */ | ||
4 | - | ||
5 | -#include <msp430.h> | ||
6 | - | ||
7 | -#define LED_ON() (P1OUT |= BIT6) | ||
8 | -#define LED_OFF() (P1OUT &= ~BIT6) | ||
9 | -#define LED_READ() (P1OUT & BIT6) | ||
10 | -#define LED_TOGGLE() (P1OUT ^= BIT6) | ||
11 | - | ||
12 | -#define CONNECTED_LED_ON() (P1OUT |= BIT0) | ||
13 | -#define CONNECTED_LED_OFF() (P1OUT &= ~BIT0) | ||
14 | - | ||
15 | -#define EAP_RX_BUF UCA0RXBUF | ||
16 | -#define EAP_TX_BUF UCA0TXBUF | ||
17 | - | ||
18 | -#define EAP_RX_VECTOR USCIAB0RX_VECTOR | ||
19 | -#define EAP_TX_VECTOR PORT2_VECTOR | ||
20 | - | ||
21 | -#define EAP_RX_ACK_CONFIG() (P2DIR |= BIT0) | ||
22 | -#define EAP_RX_ACK_SET() (P2OUT |= BIT0) | ||
23 | -#define EAP_RX_ACK_CLR() (P2OUT &= ~BIT0) | ||
24 | - | ||
25 | -#define EAP_TX_INT_CONFIG() (P2DIR &= ~BIT1, P2IES |= BIT1, P2IFG &= BIT1, P2IE |= BIT1) | ||
26 | -#define EAP_TX_INT_TST() (P2IFG & BIT1) | ||
27 | -#define EAP_TX_INT_CLR() (P2IFG &= ~BIT1) | ||
28 | - | ||
29 | -void init(void) { | ||
30 | - | ||
31 | - WDTCTL = WDTPW + WDTHOLD; | ||
32 | - BCSCTL2 = SELM_0 + DIVM_0 + DIVS_0; | ||
33 | - if (CALBC1_1MHZ != 0xFF) { | ||
34 | - DCOCTL = 0x00; | ||
35 | - BCSCTL1 = CALBC1_1MHZ; /* Set DCO to 1MHz */ | ||
36 | - DCOCTL = CALDCO_1MHZ; | ||
37 | - } | ||
38 | - BCSCTL1 |= XT2OFF + DIVA_0; | ||
39 | - BCSCTL3 = XT2S_0 + LFXT1S_2 + XCAP_1; | ||
40 | - | ||
41 | - P1DIR |= BIT0; /* LED */ | ||
42 | - LED_OFF(); | ||
43 | - P1DIR |= BIT6; /* CONNECTED_LED */ | ||
44 | - CONNECTED_LED_OFF(); | ||
45 | - | ||
46 | - UCA0CTL1 |= UCSWRST; | ||
47 | - | ||
48 | - P1SEL |= BIT1 + BIT2; | ||
49 | - P1SEL2 |= BIT1 + BIT2; | ||
50 | - | ||
51 | - EAP_RX_ACK_CONFIG(); | ||
52 | - EAP_RX_ACK_SET(); | ||
53 | - | ||
54 | - EAP_TX_INT_CONFIG(); | ||
55 | - | ||
56 | - UCA0CTL1 = UCSSEL_2 + UCSWRST; | ||
57 | - UCA0MCTL = UCBRF_0 + UCBRS_6; | ||
58 | - UCA0BR0 = 8; | ||
59 | - UCA0CTL1 &= ~UCSWRST; | ||
60 | - | ||
61 | - IFG2 &= ~(UCA0RXIFG); | ||
62 | - IE2 |= UCA0RXIE; | ||
63 | - | ||
64 | - TA1CCTL0 = CM_0 + CCIS_0 + OUTMOD_0 + CCIE; | ||
65 | - TA1CCR0 = 1200; | ||
66 | - TA1CTL = TASSEL_1 + ID_0 + MC_1; | ||
67 | - | ||
68 | - __enable_interrupt(); | ||
69 | -} | ||
70 | - | ||
71 | -/* | ||
72 | - * ============ Serial Driver ============ | ||
73 | - */ | ||
74 | - | ||
75 | -#include <Em_Message.h> | ||
76 | - | ||
77 | -__attribute__((interrupt(EAP_RX_VECTOR))) | ||
78 | -static void rxHandler(void) { | ||
79 | - uint8_t b = EAP_RX_BUF; | ||
80 | - if (Em_Message_addByte(b)) { | ||
81 | - Em_Message_dispatch(); | ||
82 | - } | ||
83 | - EAP_RX_ACK_CLR(); | ||
84 | - EAP_RX_ACK_SET(); | ||
85 | -} | ||
86 | - | ||
87 | -__attribute__((interrupt(EAP_TX_VECTOR))) | ||
88 | -static void txHandler(void) { | ||
89 | - if (EAP_TX_INT_TST()) { | ||
90 | - uint8_t b; | ||
91 | - if (Em_Message_getByte(&b)) { | ||
92 | - EAP_TX_BUF = b; | ||
93 | - } | ||
94 | - EAP_TX_INT_CLR(); | ||
95 | - } | ||
96 | -} | ||
97 | - | ||
98 | -void Em_Message_startSend() { | ||
99 | - uint8_t b; | ||
100 | - if (Em_Message_getByte(&b)) { | ||
101 | - UCA0TXBUF = b; | ||
102 | - } | ||
103 | -} | ||
104 | - | ||
105 | -uint8_t Em_Message_lock() { | ||
106 | - uint8_t key; | ||
107 | - asm ("MOV r2, %0": "=r" (key)); | ||
108 | - key &= 0x8; | ||
109 | - asm ("DINT"); | ||
110 | - return key; | ||
111 | -} | ||
112 | - | ||
113 | -void Em_Message_unlock(uint8_t key) { | ||
114 | - if (key) { | ||
115 | - asm ("EINT"); | ||
116 | - } | ||
117 | - else { | ||
118 | - asm ("DINT"); | ||
119 | - } | ||
120 | -} | ||
121 | - | ||
122 | -/* | ||
123 | - * ============ Application Program ============ | ||
124 | - */ | ||
125 | - | ||
126 | -#include <Blinker.h> | ||
127 | - | ||
128 | -#define COUNT_DEFAULT 5 | ||
129 | - | ||
130 | -volatile Blinker_cmd_t cmdRes = Blinker_STOP_CMD; | ||
131 | -volatile Blinker_count_t countRes = COUNT_DEFAULT; | ||
132 | -volatile Blinker_delay_t delayRes = Blinker_delay_min; | ||
133 | - | ||
134 | -volatile Blinker_count_t curCount; | ||
135 | -volatile Blinker_delay_t curTime; | ||
136 | - | ||
137 | -__attribute__((interrupt(TIMER1_A0_VECTOR))) | ||
138 | -void tickHandler(void) { | ||
139 | - if (cmdRes == Blinker_STOP_CMD) { | ||
140 | - return; | ||
141 | - } | ||
142 | - if (curTime < delayRes) { | ||
143 | - curTime += Blinker_delay_step; | ||
144 | - return; | ||
145 | - } | ||
146 | - else { | ||
147 | - curTime = 0; | ||
148 | - } | ||
149 | - if (curCount-- > 0) { | ||
150 | - LED_TOGGLE(); | ||
151 | - } | ||
152 | - else { | ||
153 | - cmdRes = Blinker_STOP_CMD; | ||
154 | - LED_OFF(); | ||
155 | - } | ||
156 | - Blinker_ledState_indicate(); | ||
157 | -} | ||
158 | - | ||
159 | -int main(int argc, char *argv[]) { | ||
160 | - volatile int dummy = 0; | ||
161 | - init(); | ||
162 | - Blinker_run(); | ||
163 | - while (dummy == 0) { | ||
164 | - /* idle */ | ||
165 | - } | ||
166 | - return 0; | ||
167 | -} | ||
168 | - | ||
169 | -void Blinker_connectHandler(void) { | ||
170 | - CONNECTED_LED_ON(); | ||
171 | -} | ||
172 | - | ||
173 | -void Blinker_disconnectHandler(void) { | ||
174 | - CONNECTED_LED_OFF(); | ||
175 | -} | ||
176 | - | ||
177 | -void Blinker_cmd_store(Blinker_cmd_t* input) { | ||
178 | - cmdRes = *input; | ||
179 | - switch (cmdRes) { | ||
180 | - case Blinker_START_CMD: | ||
181 | - curCount = countRes * 2; | ||
182 | - curTime = 0; | ||
183 | - break; | ||
184 | - case Blinker_STOP_CMD: | ||
185 | - LED_OFF(); | ||
186 | - break; | ||
187 | - } | ||
188 | -} | ||
189 | - | ||
190 | -void Blinker_count_fetch(Blinker_count_t* output) { | ||
191 | - *output = countRes; | ||
192 | -} | ||
193 | - | ||
194 | -void Blinker_count_store(Blinker_count_t* input) { | ||
195 | - countRes = *input; | ||
196 | -} | ||
197 | - | ||
198 | -void Blinker_delay_fetch(Blinker_delay_t* output) { | ||
199 | - *output = delayRes; | ||
200 | -} | ||
201 | - | ||
202 | -void Blinker_delay_store(Blinker_delay_t* input) { | ||
203 | - delayRes = *input; | ||
204 | -} | ||
205 | - | ||
206 | -void Blinker_ledState_fetch(Blinker_ledState_t* output) { | ||
207 | - *output = LED_READ() ? Blinker_LED_ON : Blinker_LED_OFF; | ||
208 | -} |
BlinkerLaunchPad/main.map deleted
1 | -Archive member included because of file (symbol) | ||
2 | - | ||
3 | -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) | ||
4 | - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o (_reset_vector__) | ||
5 | -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
6 | - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__watchdog_support) | ||
7 | -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) | ||
8 | - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__init_stack) | ||
9 | -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) | ||
10 | - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__low_level_init) | ||
11 | -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) | ||
12 | - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__do_copy_data) | ||
13 | -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) | ||
14 | - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__do_clear_bss) | ||
15 | -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) | ||
16 | - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (__stop_progExec__) | ||
17 | -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) | ||
18 | - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) (_endless_loop__) | ||
19 | -/Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) | ||
20 | - /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o (_unexpected_) | ||
21 | - | ||
22 | -Allocating common symbols | ||
23 | -Common symbol size file | ||
24 | - | ||
25 | -Em_App_recvIdx 0x1 Blinker.obj | ||
26 | -Em_App_xmitSize 0x1 Blinker.obj | ||
27 | -Em_App_outBuf 0x2 Blinker.obj | ||
28 | -curTime 0x2 main.obj | ||
29 | -Em_App_ind 0xa Blinker.obj | ||
30 | -Em_App_xmitMask 0x4 Blinker.obj | ||
31 | -Em_App_msg 0x1a Blinker.obj | ||
32 | -Em_App_recvSize 0x1 Blinker.obj | ||
33 | -Em_App_fileIndex 0x4 Blinker.obj | ||
34 | -Em_App_pdHdlr 0x2 Blinker.obj | ||
35 | -Em_App_xmitIdx 0x1 Blinker.obj | ||
36 | -curCount 0x2 main.obj | ||
37 | - | ||
38 | -Memory Configuration | ||
39 | - | ||
40 | -Name Origin Length Attributes | ||
41 | -sfr 0x0000000000000000 0x0000000000000010 | ||
42 | -peripheral_8bit 0x0000000000000010 0x00000000000000f0 | ||
43 | -peripheral_16bit 0x0000000000000100 0x0000000000000100 | ||
44 | -ram 0x0000000000000200 0x0000000000000200 xw | ||
45 | -infomem 0x0000000000001000 0x0000000000000100 | ||
46 | -infod 0x0000000000001000 0x0000000000000040 | ||
47 | -infoc 0x0000000000001040 0x0000000000000040 | ||
48 | -infob 0x0000000000001080 0x0000000000000040 | ||
49 | -infoa 0x00000000000010c0 0x0000000000000040 | ||
50 | -rom 0x000000000000c000 0x0000000000003fe0 xr | ||
51 | -vectors 0x000000000000ffe0 0x0000000000000020 | ||
52 | -bsl 0x0000000000000000 0x0000000000000000 | ||
53 | -far_rom 0x0000000000000000 0x0000000000000000 | ||
54 | -*default* 0x0000000000000000 0xffffffffffffffff | ||
55 | - | ||
56 | -Linker script and memory map | ||
57 | - | ||
58 | -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o | ||
59 | -LOAD main.obj | ||
60 | -LOAD Blinker.obj | ||
61 | -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libgcc.a | ||
62 | -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/../../../../msp430/lib/libc.a | ||
63 | -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libgcc.a | ||
64 | -LOAD /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a | ||
65 | - 0x0000000000000040 PROVIDE (__info_segment_size, 0x40) | ||
66 | - 0x0000000000001000 PROVIDE (__infod, 0x1000) | ||
67 | - 0x0000000000001040 PROVIDE (__infoc, 0x1040) | ||
68 | - 0x0000000000001080 PROVIDE (__infob, 0x1080) | ||
69 | - 0x00000000000010c0 PROVIDE (__infoa, 0x10c0) | ||
70 | - 0x0000000000000000 __IE1 = 0x0 | ||
71 | - 0x0000000000000002 __IFG1 = 0x2 | ||
72 | - 0x0000000000000001 __IE2 = 0x1 | ||
73 | - 0x0000000000000003 __IFG2 = 0x3 | ||
74 | - 0x0000000000000048 __ADC10DTC0 = 0x48 | ||
75 | - 0x0000000000000049 __ADC10DTC1 = 0x49 | ||
76 | - 0x000000000000004a __ADC10AE0 = 0x4a | ||
77 | - 0x00000000000001b0 __ADC10CTL0 = 0x1b0 | ||
78 | - 0x00000000000001b2 __ADC10CTL1 = 0x1b2 | ||
79 | - 0x00000000000001b4 __ADC10MEM = 0x1b4 | ||
80 | - 0x00000000000001bc __ADC10SA = 0x1bc | ||
81 | - 0x0000000000000056 __DCOCTL = 0x56 | ||
82 | - 0x0000000000000057 __BCSCTL1 = 0x57 | ||
83 | - 0x0000000000000058 __BCSCTL2 = 0x58 | ||
84 | - 0x0000000000000053 __BCSCTL3 = 0x53 | ||
85 | - 0x0000000000000059 __CACTL1 = 0x59 | ||
86 | - 0x000000000000005a __CACTL2 = 0x5a | ||
87 | - 0x000000000000005b __CAPD = 0x5b | ||
88 | - 0x0000000000000128 __FCTL1 = 0x128 | ||
89 | - 0x000000000000012a __FCTL2 = 0x12a | ||
90 | - 0x000000000000012c __FCTL3 = 0x12c | ||
91 | - 0x0000000000000020 __P1IN = 0x20 | ||
92 | - 0x0000000000000021 __P1OUT = 0x21 | ||
93 | - 0x0000000000000022 __P1DIR = 0x22 | ||
94 | - 0x0000000000000023 __P1IFG = 0x23 | ||
95 | - 0x0000000000000024 __P1IES = 0x24 | ||
96 | - 0x0000000000000025 __P1IE = 0x25 | ||
97 | - 0x0000000000000026 __P1SEL = 0x26 | ||
98 | - 0x0000000000000041 __P1SEL2 = 0x41 | ||
99 | - 0x0000000000000027 __P1REN = 0x27 | ||
100 | - 0x0000000000000028 __P2IN = 0x28 | ||
101 | - 0x0000000000000029 __P2OUT = 0x29 | ||
102 | - 0x000000000000002a __P2DIR = 0x2a | ||
103 | - 0x000000000000002b __P2IFG = 0x2b | ||
104 | - 0x000000000000002c __P2IES = 0x2c | ||
105 | - 0x000000000000002d __P2IE = 0x2d | ||
106 | - 0x000000000000002e __P2SEL = 0x2e | ||
107 | - 0x0000000000000042 __P2SEL2 = 0x42 | ||
108 | - 0x000000000000002f __P2REN = 0x2f | ||
109 | - 0x0000000000000018 __P3IN = 0x18 | ||
110 | - 0x0000000000000019 __P3OUT = 0x19 | ||
111 | - 0x000000000000001a __P3DIR = 0x1a | ||
112 | - 0x000000000000001b __P3SEL = 0x1b | ||
113 | - 0x0000000000000043 __P3SEL2 = 0x43 | ||
114 | - 0x0000000000000010 __P3REN = 0x10 | ||
115 | - 0x000000000000012e __TA0IV = 0x12e | ||
116 | - 0x0000000000000160 __TA0CTL = 0x160 | ||
117 | - 0x0000000000000162 __TA0CCTL0 = 0x162 | ||
118 | - 0x0000000000000164 __TA0CCTL1 = 0x164 | ||
119 | - 0x0000000000000166 __TA0CCTL2 = 0x166 | ||
120 | - 0x0000000000000170 __TA0R = 0x170 | ||
121 | - 0x0000000000000172 __TA0CCR0 = 0x172 | ||
122 | - 0x0000000000000174 __TA0CCR1 = 0x174 | ||
123 | - 0x0000000000000176 __TA0CCR2 = 0x176 | ||
124 | - 0x000000000000011e __TA1IV = 0x11e | ||
125 | - 0x0000000000000180 __TA1CTL = 0x180 | ||
126 | - 0x0000000000000182 __TA1CCTL0 = 0x182 | ||
127 | - 0x0000000000000184 __TA1CCTL1 = 0x184 | ||
128 | - 0x0000000000000186 __TA1CCTL2 = 0x186 | ||
129 | - 0x0000000000000190 __TA1R = 0x190 | ||
130 | - 0x0000000000000192 __TA1CCR0 = 0x192 | ||
131 | - 0x0000000000000194 __TA1CCR1 = 0x194 | ||
132 | - 0x0000000000000196 __TA1CCR2 = 0x196 | ||
133 | - 0x0000000000000060 __UCA0CTL0 = 0x60 | ||
134 | - 0x0000000000000061 __UCA0CTL1 = 0x61 | ||
135 | - 0x0000000000000062 __UCA0BR0 = 0x62 | ||
136 | - 0x0000000000000063 __UCA0BR1 = 0x63 | ||
137 | - 0x0000000000000064 __UCA0MCTL = 0x64 | ||
138 | - 0x0000000000000065 __UCA0STAT = 0x65 | ||
139 | - 0x0000000000000066 __UCA0RXBUF = 0x66 | ||
140 | - 0x0000000000000067 __UCA0TXBUF = 0x67 | ||
141 | - 0x000000000000005d __UCA0ABCTL = 0x5d | ||
142 | - 0x000000000000005e __UCA0IRTCTL = 0x5e | ||
143 | - 0x000000000000005f __UCA0IRRCTL = 0x5f | ||
144 | - 0x0000000000000068 __UCB0CTL0 = 0x68 | ||
145 | - 0x0000000000000069 __UCB0CTL1 = 0x69 | ||
146 | - 0x000000000000006a __UCB0BR0 = 0x6a | ||
147 | - 0x000000000000006b __UCB0BR1 = 0x6b | ||
148 | - 0x000000000000006c __UCB0I2CIE = 0x6c | ||
149 | - 0x000000000000006d __UCB0STAT = 0x6d | ||
150 | - 0x000000000000006e __UCB0RXBUF = 0x6e | ||
151 | - 0x000000000000006f __UCB0TXBUF = 0x6f | ||
152 | - 0x0000000000000118 __UCB0I2COA = 0x118 | ||
153 | - 0x000000000000011a __UCB0I2CSA = 0x11a | ||
154 | - 0x0000000000000120 __WDTCTL = 0x120 | ||
155 | - 0x00000000000010f8 __CALDCO_16MHZ = 0x10f8 | ||
156 | - 0x00000000000010f9 __CALBC1_16MHZ = 0x10f9 | ||
157 | - 0x00000000000010fa __CALDCO_12MHZ = 0x10fa | ||
158 | - 0x00000000000010fb __CALBC1_12MHZ = 0x10fb | ||
159 | - 0x00000000000010fc __CALDCO_8MHZ = 0x10fc | ||
160 | - 0x00000000000010fd __CALBC1_8MHZ = 0x10fd | ||
161 | - 0x00000000000010fe __CALDCO_1MHZ = 0x10fe | ||
162 | - 0x00000000000010ff __CALBC1_1MHZ = 0x10ff | ||
163 | - | ||
164 | -.hash | ||
165 | - *(.hash) | ||
166 | - | ||
167 | -.dynsym | ||
168 | - *(.dynsym) | ||
169 | - | ||
170 | -.dynstr | ||
171 | - *(.dynstr) | ||
172 | - | ||
173 | -.gnu.version | ||
174 | - *(.gnu.version) | ||
175 | - | ||
176 | -.gnu.version_d | ||
177 | - *(.gnu.version_d) | ||
178 | - | ||
179 | -.gnu.version_r | ||
180 | - *(.gnu.version_r) | ||
181 | - | ||
182 | -.rel.init | ||
183 | - *(.rel.init) | ||
184 | - | ||
185 | -.rela.init | ||
186 | - *(.rela.init) | ||
187 | - | ||
188 | -.rel.fini | ||
189 | - *(.rel.fini) | ||
190 | - | ||
191 | -.rela.fini | ||
192 | - *(.rela.fini) | ||
193 | - | ||
194 | -.rel.text | ||
195 | - *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) | ||
196 | - | ||
197 | -.rela.text | ||
198 | - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) | ||
199 | - | ||
200 | -.rel.rodata | ||
201 | - *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) | ||
202 | - | ||
203 | -.rela.rodata | ||
204 | - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) | ||
205 | - | ||
206 | -.rel.data | ||
207 | - *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) | ||
208 | - | ||
209 | -.rela.data | ||
210 | - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) | ||
211 | - | ||
212 | -.rel.bss | ||
213 | - *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) | ||
214 | - | ||
215 | -.rela.bss | ||
216 | - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) | ||
217 | - | ||
218 | -.rel.ctors | ||
219 | - *(.rel.ctors) | ||
220 | - | ||
221 | -.rela.ctors | ||
222 | - *(.rela.ctors) | ||
223 | - | ||
224 | -.rel.dtors | ||
225 | - *(.rel.dtors) | ||
226 | - | ||
227 | -.rela.dtors | ||
228 | - *(.rela.dtors) | ||
229 | - | ||
230 | -.rel.got | ||
231 | - *(.rel.got) | ||
232 | - | ||
233 | -.rela.got | ||
234 | - *(.rela.got) | ||
235 | - | ||
236 | -.rel.plt | ||
237 | - *(.rel.plt) | ||
238 | - | ||
239 | -.rela.plt | ||
240 | - *(.rela.plt) | ||
241 | - | ||
242 | -.text 0x000000000000c000 0x656 | ||
243 | - 0x000000000000c000 . = ALIGN (0x2) | ||
244 | - *(.init .init.*) | ||
245 | - *(.init0) | ||
246 | - .init0 0x000000000000c000 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) | ||
247 | - 0x000000000000c000 _reset_vector__ | ||
248 | - *(.init1) | ||
249 | - .init1 0x000000000000c000 0xc /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
250 | - 0x000000000000c000 __watchdog_support | ||
251 | - *(.init2) | ||
252 | - .init2 0x000000000000c00c 0x4 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) | ||
253 | - 0x000000000000c00c __init_stack | ||
254 | - *(.init3) | ||
255 | - .init3 0x000000000000c010 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) | ||
256 | - 0x000000000000c010 __low_level_init | ||
257 | - *(.init4) | ||
258 | - .init4 0x000000000000c010 0x18 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) | ||
259 | - 0x000000000000c010 __do_copy_data | ||
260 | - .init4 0x000000000000c028 0x16 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) | ||
261 | - 0x000000000000c028 __do_clear_bss | ||
262 | - *(.init5) | ||
263 | - *(.init6) | ||
264 | - *(.init7) | ||
265 | - *(.init8) | ||
266 | - *(.init9) | ||
267 | - .init9 0x000000000000c03e 0x18 main.obj | ||
268 | - 0x000000000000c03e main | ||
269 | - *(.fini9) | ||
270 | - .fini9 0x000000000000c056 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) | ||
271 | - 0x000000000000c056 __stop_progExec__ | ||
272 | - *(.fini8) | ||
273 | - *(.fini7) | ||
274 | - *(.fini6) | ||
275 | - *(.fini5) | ||
276 | - *(.fini4) | ||
277 | - *(.fini3) | ||
278 | - *(.fini2) | ||
279 | - *(.fini1) | ||
280 | - *(.fini0) | ||
281 | - .fini0 0x000000000000c056 0x6 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) | ||
282 | - 0x000000000000c056 _endless_loop__ | ||
283 | - *(.fini .fini.*) | ||
284 | - 0x000000000000c05c . = ALIGN (0x2) | ||
285 | - 0x000000000000c05c __ctors_start = . | ||
286 | - *(.ctors) | ||
287 | - 0x000000000000c05c __ctors_end = . | ||
288 | - 0x000000000000c05c __dtors_start = . | ||
289 | - *(.dtors) | ||
290 | - 0x000000000000c05c __dtors_end = . | ||
291 | - 0x000000000000c05c . = ALIGN (0x2) | ||
292 | - *(.text .text.* .gnu.linkonce.t.*) | ||
293 | - .text 0x000000000000c05c 0x4 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o | ||
294 | - 0x000000000000c05c __isr_1 | ||
295 | - 0x000000000000c05c __isr_4 | ||
296 | - 0x000000000000c05c __isr_11 | ||
297 | - 0x000000000000c05c __isr_5 | ||
298 | - 0x000000000000c05c __isr_2 | ||
299 | - 0x000000000000c05c __isr_10 | ||
300 | - 0x000000000000c05c __isr_0 | ||
301 | - 0x000000000000c05c __isr_8 | ||
302 | - 0x000000000000c05c __isr_12 | ||
303 | - 0x000000000000c05c __isr_9 | ||
304 | - 0x000000000000c05c __isr_6 | ||
305 | - 0x000000000000c05c __isr_14 | ||
306 | - .text.crt0 0x000000000000c060 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o | ||
307 | - .text 0x000000000000c060 0x1f4 main.obj | ||
308 | - 0x000000000000c060 init | ||
309 | - 0x000000000000c104 __isr_7 | ||
310 | - 0x000000000000c130 __isr_3 | ||
311 | - 0x000000000000c162 Em_Message_startSend | ||
312 | - 0x000000000000c176 Em_Message_lock | ||
313 | - 0x000000000000c17e Em_Message_unlock | ||
314 | - 0x000000000000c18a tickHandler | ||
315 | - 0x000000000000c18a __isr_13 | ||
316 | - 0x000000000000c1ea Blinker_connectHandler | ||
317 | - 0x000000000000c1f0 Blinker_disconnectHandler | ||
318 | - 0x000000000000c1f8 Blinker_cmd_store | ||
319 | - 0x000000000000c222 Blinker_count_fetch | ||
320 | - 0x000000000000c22a Blinker_count_store | ||
321 | - 0x000000000000c230 Blinker_delay_fetch | ||
322 | - 0x000000000000c238 Blinker_delay_store | ||
323 | - 0x000000000000c23e Blinker_ledState_fetch | ||
324 | - .text 0x000000000000c254 0x400 Blinker.obj | ||
325 | - 0x000000000000c254 Em_Message_addByte | ||
326 | - 0x000000000000c29c Blinker_reset | ||
327 | - 0x000000000000c2ca Blinker_run | ||
328 | - 0x000000000000c2d0 Em_App_startIndSend | ||
329 | - 0x000000000000c2ea Blinker_pairingOn | ||
330 | - 0x000000000000c30c Blinker_pairingOff | ||
331 | - 0x000000000000c316 Blinker_disconnect | ||
332 | - 0x000000000000c338 Blinker_accept | ||
333 | - 0x000000000000c356 Em_App_startResSend | ||
334 | - 0x000000000000c370 Em_App_xmitReady | ||
335 | - 0x000000000000c3c4 Em_App_sendResponse | ||
336 | - 0x000000000000c3e8 Em_App_sysStoreDispatch | ||
337 | - 0x000000000000c402 Em_App_sysFetchDispatch | ||
338 | - 0x000000000000c482 Em_App_fetchDispatch | ||
339 | - 0x000000000000c4c0 Em_App_storeDispatch | ||
340 | - 0x000000000000c4f8 Em_Message_dispatch | ||
341 | - 0x000000000000c556 Em_App_sendIndicator | ||
342 | - 0x000000000000c586 Em_Message_getByte | ||
343 | - 0x000000000000c63c Blinker_ledState_indicate | ||
344 | - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) | ||
345 | - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
346 | - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) | ||
347 | - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) | ||
348 | - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) | ||
349 | - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) | ||
350 | - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) | ||
351 | - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) | ||
352 | - .text 0x000000000000c654 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) | ||
353 | - .text.crt0 0x000000000000c654 0x2 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) | ||
354 | - 0x000000000000c654 _unexpected_ | ||
355 | - 0x000000000000c656 . = ALIGN (0x2) | ||
356 | - | ||
357 | -.rodata 0x000000000000c656 0x32 | ||
358 | - 0x000000000000c656 . = ALIGN (0x2) | ||
359 | - *(.rodata .rodata.* .gnu.linkonce.r.*) | ||
360 | - .rodata 0x000000000000c656 0x32 Blinker.obj | ||
361 | - 0x000000000000c66a Em_App_endian | ||
362 | - 0x000000000000c66c Em_App_build | ||
363 | - 0x000000000000c674 Em_App_hash | ||
364 | - 0x000000000000c688 . = ALIGN (0x2) | ||
365 | - 0x000000000000c688 _etext = . | ||
366 | - | ||
367 | -.data 0x0000000000000200 0xa load address 0x000000000000c688 | ||
368 | - 0x0000000000000200 . = ALIGN (0x2) | ||
369 | - 0x0000000000000200 PROVIDE (__data_start, .) | ||
370 | - *(.data .data.* .gnu.linkonce.d.*) | ||
371 | - .data 0x0000000000000200 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o | ||
372 | - .data 0x0000000000000200 0x6 main.obj | ||
373 | - 0x0000000000000200 delayRes | ||
374 | - 0x0000000000000202 countRes | ||
375 | - 0x0000000000000204 cmdRes | ||
376 | - .data 0x0000000000000206 0x4 Blinker.obj | ||
377 | - 0x0000000000000206 Em_App_inBuf | ||
378 | - 0x0000000000000208 Em_App_readIdle | ||
379 | - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) | ||
380 | - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
381 | - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) | ||
382 | - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) | ||
383 | - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) | ||
384 | - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) | ||
385 | - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) | ||
386 | - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) | ||
387 | - .data 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) | ||
388 | - 0x000000000000020a . = ALIGN (0x2) | ||
389 | - 0x000000000000020a _edata = . | ||
390 | - 0x000000000000c688 PROVIDE (__data_load_start, LOADADDR (.data)) | ||
391 | - 0x000000000000000a PROVIDE (__data_size, SIZEOF (.data)) | ||
392 | - | ||
393 | -.bss 0x000000000000020a 0x3e load address 0x000000000000c692 | ||
394 | - 0x000000000000020a PROVIDE (__bss_start, .) | ||
395 | - *(.bss .bss.*) | ||
396 | - .bss 0x000000000000020a 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o | ||
397 | - .bss 0x000000000000020a 0x0 main.obj | ||
398 | - .bss 0x000000000000020a 0x4 Blinker.obj | ||
399 | - 0x000000000000020a Em_App_moreData | ||
400 | - 0x000000000000020c Em_App_state | ||
401 | - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_reset_vector__.o) | ||
402 | - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
403 | - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) | ||
404 | - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__low_level_init.o) | ||
405 | - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) | ||
406 | - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) | ||
407 | - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__stop_progExec__.o) | ||
408 | - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) | ||
409 | - .bss 0x000000000000020e 0x0 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) | ||
410 | - *(COMMON) | ||
411 | - COMMON 0x000000000000020e 0x4 main.obj | ||
412 | - 0x000000000000020e curTime | ||
413 | - 0x0000000000000210 curCount | ||
414 | - COMMON 0x0000000000000212 0x35 Blinker.obj | ||
415 | - 0x0000000000000212 Em_App_recvIdx | ||
416 | - 0x0000000000000213 Em_App_xmitSize | ||
417 | - 0x0000000000000214 Em_App_outBuf | ||
418 | - 0x0000000000000216 Em_App_ind | ||
419 | - 0x0000000000000220 Em_App_xmitMask | ||
420 | - 0x0000000000000224 Em_App_msg | ||
421 | - 0x000000000000023e Em_App_recvSize | ||
422 | - 0x0000000000000240 Em_App_fileIndex | ||
423 | - 0x0000000000000244 Em_App_pdHdlr | ||
424 | - 0x0000000000000246 Em_App_xmitIdx | ||
425 | - 0x0000000000000248 . = ALIGN (0x2) | ||
426 | - *fill* 0x0000000000000247 0x1 00 | ||
427 | - 0x0000000000000248 PROVIDE (__bss_end, .) | ||
428 | - 0x000000000000003e PROVIDE (__bss_size, SIZEOF (.bss)) | ||
429 | - | ||
430 | -.noinit 0x0000000000000248 0x2 load address 0x000000000000c692 | ||
431 | - 0x0000000000000248 PROVIDE (__noinit_start, .) | ||
432 | - *(.noinit .noinit.*) | ||
433 | - .noinit.crt0 0x0000000000000248 0x2 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
434 | - 0x0000000000000248 __wdt_clear_value | ||
435 | - 0x000000000000024a . = ALIGN (0x2) | ||
436 | - 0x000000000000024a PROVIDE (__noinit_end, .) | ||
437 | - 0x000000000000024a . = ALIGN (0x2) | ||
438 | - 0x000000000000024a _end = . | ||
439 | - | ||
440 | -.infomem 0x0000000000001000 0x0 | ||
441 | - *(.infomem) | ||
442 | - 0x0000000000001000 . = ALIGN (0x2) | ||
443 | - *(.infomem.*) | ||
444 | - | ||
445 | -.infomemnobits 0x0000000000001000 0x0 | ||
446 | - *(.infomemnobits) | ||
447 | - 0x0000000000001000 . = ALIGN (0x2) | ||
448 | - *(.infomemnobits.*) | ||
449 | - | ||
450 | -.infoa | ||
451 | - *(.infoa .infoa.*) | ||
452 | - | ||
453 | -.infob | ||
454 | - *(.infob .infob.*) | ||
455 | - | ||
456 | -.infoc | ||
457 | - *(.infoc .infoc.*) | ||
458 | - | ||
459 | -.infod | ||
460 | - *(.infod .infod.*) | ||
461 | - | ||
462 | -.vectors 0x000000000000ffe0 0x20 | ||
463 | - 0x000000000000ffe0 PROVIDE (__vectors_start, .) | ||
464 | - *(.vectors*) | ||
465 | - .vectors 0x000000000000ffe0 0x20 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/crt0ivtbl16.o | ||
466 | - 0x000000000000ffe0 __ivtbl_16 | ||
467 | - 0x0000000000010000 _vectors_end = . | ||
468 | - | ||
469 | -.fartext 0x0000000000000000 0x0 | ||
470 | - 0x0000000000000000 . = ALIGN (0x2) | ||
471 | - *(.fartext) | ||
472 | - 0x0000000000000000 . = ALIGN (0x2) | ||
473 | - *(.fartext.*) | ||
474 | - 0x0000000000000000 _efartext = . | ||
475 | - | ||
476 | -.profiler | ||
477 | - *(.profiler) | ||
478 | - | ||
479 | -.stab | ||
480 | - *(.stab) | ||
481 | - | ||
482 | -.stabstr | ||
483 | - *(.stabstr) | ||
484 | - | ||
485 | -.stab.excl | ||
486 | - *(.stab.excl) | ||
487 | - | ||
488 | -.stab.exclstr | ||
489 | - *(.stab.exclstr) | ||
490 | - | ||
491 | -.stab.index | ||
492 | - *(.stab.index) | ||
493 | - | ||
494 | -.stab.indexstr | ||
495 | - *(.stab.indexstr) | ||
496 | - | ||
497 | -.comment | ||
498 | - *(.comment) | ||
499 | - | ||
500 | -.debug | ||
501 | - *(.debug) | ||
502 | - | ||
503 | -.line | ||
504 | - *(.line) | ||
505 | - | ||
506 | -.debug_srcinfo | ||
507 | - *(.debug_srcinfo) | ||
508 | - | ||
509 | -.debug_sfnames | ||
510 | - *(.debug_sfnames) | ||
511 | - | ||
512 | -.debug_aranges 0x0000000000000000 0xa4 | ||
513 | - *(.debug_aranges) | ||
514 | - .debug_aranges | ||
515 | - 0x0000000000000000 0x18 main.obj | ||
516 | - .debug_aranges | ||
517 | - 0x0000000000000018 0x14 Blinker.obj | ||
518 | - .debug_aranges | ||
519 | - 0x000000000000002c 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
520 | - .debug_aranges | ||
521 | - 0x0000000000000040 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) | ||
522 | - .debug_aranges | ||
523 | - 0x0000000000000054 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) | ||
524 | - .debug_aranges | ||
525 | - 0x0000000000000068 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) | ||
526 | - .debug_aranges | ||
527 | - 0x000000000000007c 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) | ||
528 | - .debug_aranges | ||
529 | - 0x0000000000000090 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) | ||
530 | - | ||
531 | -.debug_pubnames | ||
532 | - *(.debug_pubnames) | ||
533 | - | ||
534 | -.debug_info 0x0000000000000000 0x11f6 | ||
535 | - *(.debug_info) | ||
536 | - .debug_info 0x0000000000000000 0x74e main.obj | ||
537 | - .debug_info 0x000000000000074e 0x74e Blinker.obj | ||
538 | - .debug_info 0x0000000000000e9c 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
539 | - .debug_info 0x0000000000000f2b 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) | ||
540 | - .debug_info 0x0000000000000fba 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) | ||
541 | - .debug_info 0x0000000000001049 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) | ||
542 | - .debug_info 0x00000000000010d8 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) | ||
543 | - .debug_info 0x0000000000001167 0x8f /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) | ||
544 | - *(.gnu.linkonce.wi.*) | ||
545 | - | ||
546 | -.debug_abbrev 0x0000000000000000 0x456 | ||
547 | - *(.debug_abbrev) | ||
548 | - .debug_abbrev 0x0000000000000000 0x1b0 main.obj | ||
549 | - .debug_abbrev 0x00000000000001b0 0x22e Blinker.obj | ||
550 | - .debug_abbrev 0x00000000000003de 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
551 | - .debug_abbrev 0x00000000000003f2 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) | ||
552 | - .debug_abbrev 0x0000000000000406 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) | ||
553 | - .debug_abbrev 0x000000000000041a 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) | ||
554 | - .debug_abbrev 0x000000000000042e 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) | ||
555 | - .debug_abbrev 0x0000000000000442 0x14 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) | ||
556 | - | ||
557 | -.debug_line 0x0000000000000000 0x61e | ||
558 | - *(.debug_line) | ||
559 | - .debug_line 0x0000000000000000 0x16a main.obj | ||
560 | - .debug_line 0x000000000000016a 0x205 Blinker.obj | ||
561 | - .debug_line 0x000000000000036f 0x72 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__watchdog_support.o) | ||
562 | - .debug_line 0x00000000000003e1 0x70 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(__init_stack.o) | ||
563 | - .debug_line 0x0000000000000451 0x76 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_copy_data.o) | ||
564 | - .debug_line 0x00000000000004c7 0x76 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_clear_bss.o) | ||
565 | - .debug_line 0x000000000000053d 0x71 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_endless_loop__.o) | ||
566 | - .debug_line 0x00000000000005ae 0x70 /Applications/Development/eclipse/msptools/bin/../lib/gcc/msp430/4.6.1/libcrt0.a(_unexpected_.o) | ||
567 | - | ||
568 | -.debug_frame 0x0000000000000000 0x22e | ||
569 | - *(.debug_frame) | ||
570 | - .debug_frame 0x0000000000000000 0x11a main.obj | ||
571 | - .debug_frame 0x000000000000011a 0x114 Blinker.obj | ||
572 | - | ||
573 | -.debug_str 0x0000000000000000 0x6c6 | ||
574 | - *(.debug_str) | ||
575 | - .debug_str 0x0000000000000000 0x32a main.obj | ||
576 | - 0x42a (size before relaxing) | ||
577 | - .debug_str 0x000000000000032a 0x39c Blinker.obj | ||
578 | - 0x49b (size before relaxing) | ||
579 | - | ||
580 | -.debug_loc 0x0000000000000000 0x381 | ||
581 | - *(.debug_loc) | ||
582 | - .debug_loc 0x0000000000000000 0xf6 main.obj | ||
583 | - .debug_loc 0x00000000000000f6 0x28b Blinker.obj | ||
584 | - | ||
585 | -.debug_macinfo | ||
586 | - *(.debug_macinfo) | ||
587 | - | ||
588 | -.debug_pubtypes | ||
589 | - *(.debug_pubtypes) | ||
590 | - | ||
591 | -.debug_ranges 0x0000000000000000 0xc | ||
592 | - *(.debug_ranges) | ||
593 | - .debug_ranges 0x0000000000000000 0xc main.obj | ||
594 | - 0x0000000000000400 PROVIDE (__stack, (ORIGIN (ram) + 0x200)) | ||
595 | - 0x000000000000c688 PROVIDE (__data_start_rom, _etext) | ||
596 | - 0x000000000000c692 PROVIDE (__data_end_rom, (_etext + SIZEOF (.data))) | ||
597 | -OUTPUT(main.out elf32-msp430) |
BlinkerLaunchPad/main.obj deleted
No preview for this file type
BlinkerLaunchPad/main.out deleted
No preview for this file type
BlinkerLaunchPad/makefile deleted
BlinkerSchema/.gitignore deleted
1 | -/imports |
BlinkerSchema/.project deleted
1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
2 | -<projectDescription> | ||
3 | - <name>BlinkerSchema</name> | ||
4 | - <comment></comment> | ||
5 | - <projects> | ||
6 | - </projects> | ||
7 | - <buildSpec> | ||
8 | - <buildCommand> | ||
9 | - <name>com.emmoco.mcmtooling.core.mcmToolingBuilder</name> | ||
10 | - <arguments> | ||
11 | - </arguments> | ||
12 | - </buildCommand> | ||
13 | - </buildSpec> | ||
14 | - <natures> | ||
15 | - <nature>com.emmoco.mcmtooling.core.mcmToolingNature</nature> | ||
16 | - </natures> | ||
17 | -</projectDescription> |
BlinkerSchema/Em/Blinker-STUBS.c deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-14T16:24:37T ****/ | ||
2 | -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ | ||
3 | - | ||
4 | -#include "Blinker.h" | ||
5 | - | ||
6 | -#ifdef Blinker_STUBS_ /* enables optional inclusion of application stubs */ | ||
7 | - | ||
8 | -/* Copy the function skeletons below into your own application source file */ | ||
9 | - | ||
10 | -void Blinker_connectHandler(void) { | ||
11 | - /* TODO: application is now connected */ | ||
12 | -} | ||
13 | - | ||
14 | -void Blinker_disconnectHandler(void) { | ||
15 | - /* TODO: application is now disconnected */ | ||
16 | -} | ||
17 | - | ||
18 | -void Blinker_cmd_store(Blinker_cmd_t* input) { | ||
19 | - /* TODO: write resource 'cmd' from 'input' */ | ||
20 | -} | ||
21 | - | ||
22 | -void Blinker_count_fetch(Blinker_count_t* output) { | ||
23 | - /* TODO: read resource 'count' into 'output' */ | ||
24 | -} | ||
25 | - | ||
26 | -void Blinker_count_store(Blinker_count_t* input) { | ||
27 | - /* TODO: write resource 'count' from 'input' */ | ||
28 | -} | ||
29 | - | ||
30 | -void Blinker_delay_fetch(Blinker_delay_t* output) { | ||
31 | - /* TODO: read resource 'delay' into 'output' */ | ||
32 | -} | ||
33 | - | ||
34 | -void Blinker_delay_store(Blinker_delay_t* input) { | ||
35 | - /* TODO: write resource 'delay' from 'input' */ | ||
36 | -} | ||
37 | - | ||
38 | -void Blinker_ledState_fetch(Blinker_ledState_t* output) { | ||
39 | - /* TODO: read resource 'ledState' into 'output' */ | ||
40 | -} | ||
41 | - | ||
42 | -#endif /* application stubs */ |
BlinkerSchema/Em/Blinker.c deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-14T16:24:37T ****/ | ||
2 | -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ | ||
3 | - | ||
4 | -#include "Em_Message.h" | ||
5 | -#include "Blinker.h" | ||
6 | - | ||
7 | -#ifdef __cplusplus | ||
8 | -extern "C" { | ||
9 | -#endif | ||
10 | - | ||
11 | -#define Em_Message_protocolLevel 13 | ||
12 | - | ||
13 | -typedef struct Em_App_Message { | ||
14 | - uint8_t dummy[3]; | ||
15 | - uint8_t sot; | ||
16 | - Em_Message_Header hdr; | ||
17 | - uint8_t data[20]; | ||
18 | -} Em_App_Message; | ||
19 | - | ||
20 | -const uint8_t Em_App_hash[] = {252, 123, 209, 86, 230, 104, 211, 8, 40, 191, 19, 28, 180, 183, 223, 192, 13, 0, ((sizeof(struct{uint8_t f1; uint16_t f2;}) - sizeof(uint16_t)) << 4) | (sizeof(struct{uint8_t f1; uint32_t f2;}) - sizeof(uint32_t))}; | ||
21 | - | ||
22 | -const uint8_t Em_App_build[] = {24, 231, 30, 251, 69, 1, 0, 0}; | ||
23 | - | ||
24 | -#define Em_App_APP_RESOURCE_COUNT 4 | ||
25 | -#define Em_App_SYS_RESOURCE_COUNT 9 | ||
26 | - | ||
27 | -#define Em_App_ACCEPT Blinker_accept | ||
28 | -#define Em_App_ACTIVATEPARAMETERS Blinker_activateParameters | ||
29 | -#define Em_App_BROADCASTOFF Blinker_broadcastOff | ||
30 | -#define Em_App_DISCONNECT Blinker_disconnect | ||
31 | -#define Em_App_PAIRINGON Blinker_pairingOn | ||
32 | -#define Em_App_PAIRINGOFF Blinker_pairingOff | ||
33 | -#define Em_App_RESET Blinker_reset | ||
34 | -#define Em_App_SETDEVICENAME Blinker_setDeviceName | ||
35 | -#define Em_App_START Blinker_start | ||
36 | - | ||
37 | -#define Em_App_CONNECTHANDLER Blinker_connectHandler | ||
38 | -#define Em_App_DISCONNECTHANDLER Blinker_disconnectHandler | ||
39 | - | ||
40 | -#define Em_App_MAX_INDICATOR 2 | ||
41 | - | ||
42 | -/* BEGIN common code */ | ||
43 | - | ||
44 | -enum {Em_App_IDLE, Em_App_STARTING, Em_App_DISCONNECTED, Em_App_CONNECTED}; | ||
45 | - | ||
46 | -typedef struct Em_App_Indicator { | ||
47 | - uint8_t dummy[3]; | ||
48 | - uint8_t sot; | ||
49 | - Em_Message_Header hdr; | ||
50 | - uint8_t data[Em_Message_INDSIZE]; | ||
51 | -} Em_App_Indicator; | ||
52 | - | ||
53 | -union { uint32_t align; Em_App_Message msg; } Em_App_msg_u; | ||
54 | -union { uint32_t align; Em_App_Indicator ind; } Em_App_ind_u; | ||
55 | -#define Em_App_msg Em_App_msg_u.msg | ||
56 | -#define Em_App_ind Em_App_ind_u.ind | ||
57 | - | ||
58 | -void (*Em_App_pdHdlr)(void); | ||
59 | - | ||
60 | -const uint16_t Em_App_endian = 0x0100; | ||
61 | - | ||
62 | -Em_Message_Size Em_App_recvIdx; | ||
63 | -Em_Message_Size Em_App_recvSize; | ||
64 | -Em_Message_Size Em_App_xmitIdx; | ||
65 | -Em_Message_Size Em_App_xmitSize; | ||
66 | - | ||
67 | -uint8_t Em_App_state = Em_App_IDLE; | ||
68 | -int32_t Em_App_fileIndex = 0; | ||
69 | -uint32_t Em_App_xmitMask = 0; | ||
70 | - | ||
71 | -uint8_t* Em_App_valp; | ||
72 | -uint8_t* Em_App_bufp; | ||
73 | -const char* Em_App_desc; | ||
74 | - | ||
75 | -uint8_t* Em_App_inBuf = (uint8_t*)&Em_App_msg.hdr; | ||
76 | -uint8_t* Em_App_outBuf = 0; | ||
77 | - | ||
78 | -uint8_t* _Em_Message_rxBuf = 0; | ||
79 | -uint8_t _Em_Message_rxCnt = 0; | ||
80 | - | ||
81 | -uint8_t* _Em_Message_txBuf = 0; | ||
82 | -uint8_t _Em_Message_txCnt = 0; | ||
83 | - | ||
84 | -#define Em_App_DEVNAME_LEN 9 | ||
85 | -const char* Em_App_devName = 0; | ||
86 | - | ||
87 | -void Em_App_fetchDispatch(void); | ||
88 | -void Em_Message_marshallToBuf(uint8_t* valp, uint8_t* bufp, const char* desc); | ||
89 | -void Em_Message_marshallToVal(uint8_t* valp, uint8_t* bufp, const char* desc); | ||
90 | -void Em_App_storeDispatch(void); | ||
91 | -void Em_App_sendIndicator(Em_Message_ResId indId); | ||
92 | -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size); | ||
93 | -void Em_App_startIndSend(void); | ||
94 | -void Em_App_startResSend(void); | ||
95 | -void Em_App_sysFetchDispatch(void); | ||
96 | -void Em_App_sysStoreDispatch(void); | ||
97 | -bool Em_App_xmitReady(Em_Message_ResId indId); | ||
98 | - | ||
99 | -void Em_Message_nextXmit(void) { | ||
100 | - uint8_t key = Em_Hal_lock(); | ||
101 | - if (Em_App_xmitMask != 0) { | ||
102 | - uint8_t i; | ||
103 | - uint32_t m; | ||
104 | - for (i = 0, m = 0x1; i < Em_App_MAX_INDICATOR; i++, m <<= 1) { | ||
105 | - if (Em_App_xmitMask & m) { | ||
106 | - Em_App_xmitMask &= ~m; | ||
107 | - if (i == 0) { | ||
108 | - Em_App_startResSend(); | ||
109 | - } | ||
110 | - else { | ||
111 | - Em_App_sendIndicator(i - 1); | ||
112 | - } | ||
113 | - break; | ||
114 | - } | ||
115 | - } | ||
116 | - } | ||
117 | - Em_Hal_unlock(key); | ||
118 | -} | ||
119 | - | ||
120 | -void Em_Message_restart(void) { | ||
121 | - Em_App_START(); | ||
122 | -} | ||
123 | - | ||
124 | -void Em_App_ACCEPT(bool enable) { | ||
125 | - if (Em_App_state == Em_App_CONNECTED) { | ||
126 | - return; | ||
127 | - } | ||
128 | - Em_App_ind.sot = 0; | ||
129 | - Em_App_ind.hdr.kind = Em_Message_ACCEPT; | ||
130 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
131 | - Em_App_ind.hdr.resId = enable; | ||
132 | - Em_App_startIndSend(); | ||
133 | -} | ||
134 | - | ||
135 | -void Em_App_ACTIVATEPARAMETERS(uint8_t group) { | ||
136 | - if (Em_App_state == Em_App_IDLE || Em_App_state == Em_App_STARTING) { | ||
137 | - return; | ||
138 | - } | ||
139 | - Em_App_ind.sot = 0; | ||
140 | - Em_App_ind.hdr.kind = Em_Message_ACTIVE_PARAMS; | ||
141 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
142 | - Em_App_ind.hdr.resId = group; | ||
143 | - Em_App_startIndSend(); | ||
144 | -} | ||
145 | - | ||
146 | -void Em_App_BROADCASTOFF(void) { | ||
147 | - Em_App_ind.sot = 0; | ||
148 | - Em_App_ind.hdr.kind = Em_Message_INDICATOR; | ||
149 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
150 | - Em_App_ind.hdr.resId = 0; | ||
151 | - Em_App_startIndSend(); | ||
152 | -} | ||
153 | - | ||
154 | -void Em_App_DISCONNECT(void) { | ||
155 | - if (Em_App_state != Em_App_CONNECTED) { | ||
156 | - return; | ||
157 | - } | ||
158 | - Em_App_state = Em_App_DISCONNECTED; | ||
159 | - Em_App_ind.sot = 0; | ||
160 | - Em_App_ind.hdr.kind = Em_Message_DISCONNECT; | ||
161 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
162 | - Em_App_ind.hdr.resId = 0; | ||
163 | - Em_App_startIndSend(); | ||
164 | -} | ||
165 | - | ||
166 | -void Em_Message_dispatch(void) { | ||
167 | - if (Em_App_state == Em_App_IDLE) { | ||
168 | - return; | ||
169 | - } | ||
170 | - switch (Em_App_msg.hdr.kind) { | ||
171 | - case Em_Message_CONNECT: | ||
172 | - Em_App_state = Em_App_CONNECTED; | ||
173 | - Em_App_CONNECTHANDLER(); | ||
174 | - break; | ||
175 | - case Em_Message_DISCONNECT: | ||
176 | - Em_App_state = Em_App_DISCONNECTED; | ||
177 | - Em_App_DISCONNECTHANDLER(); | ||
178 | - break; | ||
179 | - case Em_Message_PAIRING_DONE: | ||
180 | - if (Em_App_pdHdlr) { | ||
181 | - (*Em_App_pdHdlr)(); | ||
182 | - } | ||
183 | - break; | ||
184 | - case Em_Message_FETCH: | ||
185 | - if (Em_App_msg.hdr.resId < 0x80) { | ||
186 | - Em_App_fetchDispatch(); | ||
187 | - } | ||
188 | - else { | ||
189 | - Em_App_sysFetchDispatch(); | ||
190 | - } | ||
191 | - break; | ||
192 | - case Em_Message_STORE: | ||
193 | - if (Em_App_msg.hdr.resId < 0x80) { | ||
194 | - Em_App_storeDispatch(); | ||
195 | - } | ||
196 | - else { | ||
197 | - Em_App_sysStoreDispatch(); | ||
198 | - } | ||
199 | - break; | ||
200 | - } | ||
201 | -} | ||
202 | - | ||
203 | -void Em_App_marshallToBuf() { | ||
204 | - char ch; | ||
205 | - while ((ch = *Em_App_desc++)) { | ||
206 | - switch (ch) { | ||
207 | - case '0' : { | ||
208 | - *Em_App_bufp++ = 0; | ||
209 | - break; | ||
210 | - } | ||
211 | - case '1' : { | ||
212 | - *Em_App_bufp++ = *Em_App_valp & 0xFF; | ||
213 | - break; | ||
214 | - } | ||
215 | - case '2' : { | ||
216 | - uint16_t v16 = *(uint16_t*)Em_App_valp; | ||
217 | - *Em_App_bufp++ = v16 & 0xFF; | ||
218 | - *Em_App_bufp++ = (v16 >> 8) & 0xFF; | ||
219 | - break; | ||
220 | - } | ||
221 | - case '4' : { | ||
222 | - if (((uint32_t)Em_App_valp & 0x1)) Em_App_valp++; | ||
223 | - uint32_t v32 = *(uint32_t*)Em_App_valp++; | ||
224 | - *Em_App_bufp++ = v32 & 0xFF; | ||
225 | - *Em_App_bufp++ = (v32 >> 8) & 0xFF; | ||
226 | - *Em_App_bufp++ = (v32 >> 16) & 0xFF; | ||
227 | - *Em_App_bufp++ = (v32 >> 24) & 0xFF; | ||
228 | - break; | ||
229 | - } | ||
230 | - } | ||
231 | - Em_App_valp += 1; | ||
232 | - } | ||
233 | -} | ||
234 | - | ||
235 | -void Em_App_marshallToVal() { | ||
236 | - char ch; | ||
237 | - while ((ch = *Em_App_desc++)) { | ||
238 | - switch (ch) { | ||
239 | - case '0' : { | ||
240 | - *Em_App_valp = 0; | ||
241 | - Em_App_bufp += 1; | ||
242 | - break; | ||
243 | - } | ||
244 | - case '1' : { | ||
245 | - *Em_App_valp = *Em_App_bufp++ & 0xFF; | ||
246 | - break; | ||
247 | - } | ||
248 | - case '2' : { | ||
249 | - uint16_t v16 = *Em_App_bufp++ & 0xFF; | ||
250 | - v16 |= (*Em_App_bufp++ << 8); | ||
251 | - *(uint16_t*)Em_App_valp = v16; | ||
252 | - break; | ||
253 | - } | ||
254 | - case '4' : { | ||
255 | - if (((uint32_t)Em_App_valp & 0x1)) Em_App_valp++; | ||
256 | - uint32_t v32 = (uint32_t)*Em_App_bufp++ & 0xFF; | ||
257 | - v32 |= ((uint32_t)*Em_App_bufp++ << 8); | ||
258 | - v32 |= ((uint32_t)*Em_App_bufp++ << 16); | ||
259 | - v32 |= ((uint32_t)*Em_App_bufp++ << 24); | ||
260 | - *(uint32_t*)Em_App_valp++ = v32; | ||
261 | - break; | ||
262 | - } | ||
263 | - } | ||
264 | - Em_App_valp += 1; | ||
265 | - } | ||
266 | -} | ||
267 | - | ||
268 | -void Em_App_PAIRINGOFF(void(*handler)(void)) { | ||
269 | - Em_App_PAIRINGON(0, handler); | ||
270 | -} | ||
271 | - | ||
272 | -void Em_App_PAIRINGON(uint8_t secs, void(*handler)(void)) { | ||
273 | - if (Em_App_state != Em_App_DISCONNECTED) { | ||
274 | - return; | ||
275 | - } | ||
276 | - Em_App_pdHdlr = handler; | ||
277 | - Em_App_ind.sot = 0; | ||
278 | - Em_App_ind.hdr.kind = Em_Message_PAIRING; | ||
279 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
280 | - Em_App_ind.hdr.resId = secs; | ||
281 | - Em_App_startIndSend(); | ||
282 | -} | ||
283 | - | ||
284 | -void Em_App_RESET(void) { | ||
285 | - Em_Hal_reset(); | ||
286 | - _Em_Message_rxBuf = _Em_Message_txBuf = 0; | ||
287 | - _Em_Message_rxCnt = _Em_Message_txCnt = 0; | ||
288 | - Em_App_recvIdx = Em_App_recvSize = Em_App_xmitIdx = Em_App_xmitSize = 0; | ||
289 | - Em_App_state = Em_App_IDLE; | ||
290 | - Em_App_fileIndex = 0; | ||
291 | - Em_App_xmitMask = 0; | ||
292 | -} | ||
293 | - | ||
294 | -void Em_App_SETDEVICENAME(const char* name) { | ||
295 | - Em_App_devName = name; | ||
296 | -} | ||
297 | - | ||
298 | -void Em_App_START(void) { | ||
299 | - Em_App_RESET(); | ||
300 | - Em_App_state = Em_App_STARTING; | ||
301 | -} | ||
302 | - | ||
303 | -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size) { | ||
304 | - if (Em_App_state != Em_App_IDLE) { | ||
305 | - Em_App_msg.sot = 0; | ||
306 | - Em_App_msg.hdr.kind = kind; | ||
307 | - Em_App_msg.hdr.size = size + sizeof (Em_Message_Header); | ||
308 | - if (Em_App_xmitReady(0)) { | ||
309 | - Em_App_startResSend(); | ||
310 | - } | ||
311 | - } | ||
312 | -} | ||
313 | - | ||
314 | -void Em_App_startIndSend(void) { | ||
315 | - Em_App_outBuf = (uint8_t*)&Em_App_ind.sot; | ||
316 | - Em_App_xmitSize = Em_App_ind.hdr.size + 1; | ||
317 | - Em_App_xmitIdx = 0; | ||
318 | - Em_Hal_startSend(); | ||
319 | -} | ||
320 | - | ||
321 | -void Em_App_startResSend(void) { | ||
322 | - Em_App_outBuf = (uint8_t*)&Em_App_msg.sot; | ||
323 | - Em_App_xmitSize = Em_App_msg.hdr.size + 1; | ||
324 | - Em_App_xmitIdx = 0; | ||
325 | - Em_Hal_startSend(); | ||
326 | -} | ||
327 | - | ||
328 | -void Em_App_sysFetchDispatch(void) { | ||
329 | - uint8_t size = 0; | ||
330 | - int i, j; | ||
331 | - switch (Em_App_msg.hdr.resId) { | ||
332 | - case Em_Message_SYS_SCHEMA_HASH: | ||
333 | - for (i = 0; i < sizeof (Em_App_hash); i++) { | ||
334 | - Em_App_msg.data[i] = Em_App_hash[i]; | ||
335 | - } | ||
336 | - Em_App_msg.data[sizeof (Em_App_hash)] = *((uint8_t*)&Em_App_endian); | ||
337 | - size = sizeof (Em_App_hash) + 1; | ||
338 | - break; | ||
339 | - case Em_Message_SYS_MCM_NAME: | ||
340 | - if (Em_App_devName) { | ||
341 | - for (i = 0; i < Em_App_DEVNAME_LEN; i++) { | ||
342 | - if ((Em_App_msg.data[i] = Em_App_devName[i]) == 0) { | ||
343 | - break; | ||
344 | - } | ||
345 | - } | ||
346 | - for (j = i; j < Em_App_DEVNAME_LEN; j++) { | ||
347 | - Em_App_msg.data[j] = 0; | ||
348 | - } | ||
349 | - size = Em_App_DEVNAME_LEN; | ||
350 | - } | ||
351 | - break; | ||
352 | - case Em_Message_SYS_EAP_PROTOCOL_LEVEL: | ||
353 | - *((Em_Message_protocolLevel_t*)Em_App_msg.data) = Em_Message_protocolLevel; | ||
354 | - size = sizeof (Em_Message_protocolLevel_t); | ||
355 | - break; | ||
356 | - case Em_Message_SYS_EAP_BUILD_DATE: | ||
357 | - for (i = 0; i < sizeof (Em_App_build); i++) { | ||
358 | - Em_App_msg.data[i] = Em_App_build[i]; | ||
359 | - } | ||
360 | - size = sizeof (Em_App_build); | ||
361 | - break; | ||
362 | - case Em_Message_SYS_RESOURCE_COUNT: | ||
363 | - Em_App_msg.data[0] = Em_App_APP_RESOURCE_COUNT; | ||
364 | - Em_App_msg.data[1] = Em_App_SYS_RESOURCE_COUNT; | ||
365 | - size = 2; | ||
366 | - break; | ||
367 | - } | ||
368 | - Em_App_sendResponse(Em_Message_FETCH_DONE, size); | ||
369 | -} | ||
370 | - | ||
371 | -void Em_App_sysStoreDispatch(void) { | ||
372 | - switch (Em_App_msg.hdr.resId) { | ||
373 | - case Em_Message_SYS_FILE_INDEX_RESET: | ||
374 | - Em_App_fileIndex = 0; | ||
375 | - break; | ||
376 | - } | ||
377 | - Em_App_sendResponse(Em_Message_STORE_DONE, 0); | ||
378 | -} | ||
379 | - | ||
380 | -bool Em_App_xmitReady(Em_Message_ResId indId) { | ||
381 | - uint8_t key = Em_Hal_lock(); | ||
382 | - bool res = _Em_Message_txBuf == 0 && Em_App_xmitMask == 0; | ||
383 | - if (!res) { | ||
384 | - Em_App_xmitMask |= (1 << indId); | ||
385 | - } | ||
386 | - Em_Hal_unlock(key); | ||
387 | - return res; | ||
388 | -} | ||
389 | - | ||
390 | -/* END common code */ | ||
391 | - | ||
392 | -void Em_App_fetchDispatch(void) { | ||
393 | - uint8_t size = 0; | ||
394 | - switch (Em_App_msg.hdr.resId) { | ||
395 | - case 0: { | ||
396 | - break; | ||
397 | - } | ||
398 | - case 2: { | ||
399 | -#ifdef Em_16BIT | ||
400 | - Blinker_count_t val; | ||
401 | - Em_App_valp = (uint8_t*)&val; | ||
402 | - Em_App_bufp = Em_App_msg.data; | ||
403 | - Em_App_desc = "2"; | ||
404 | - Blinker_count_fetch(&val); | ||
405 | - Em_App_marshallToBuf(); | ||
406 | -#else | ||
407 | - Blinker_count_fetch((void*)Em_App_msg.data); | ||
408 | -#endif | ||
409 | - size = 2; | ||
410 | - break; | ||
411 | - } | ||
412 | - case 3: { | ||
413 | -#ifdef Em_16BIT | ||
414 | - Blinker_delay_t val; | ||
415 | - Em_App_valp = (uint8_t*)&val; | ||
416 | - Em_App_bufp = Em_App_msg.data; | ||
417 | - Em_App_desc = "2"; | ||
418 | - Blinker_delay_fetch(&val); | ||
419 | - Em_App_marshallToBuf(); | ||
420 | -#else | ||
421 | - Blinker_delay_fetch((void*)Em_App_msg.data); | ||
422 | -#endif | ||
423 | - size = 2; | ||
424 | - break; | ||
425 | - } | ||
426 | - case 4: { | ||
427 | -#ifdef Em_16BIT | ||
428 | - Blinker_ledState_t val; | ||
429 | - Em_App_valp = (uint8_t*)&val; | ||
430 | - Em_App_bufp = Em_App_msg.data; | ||
431 | - Em_App_desc = "1"; | ||
432 | - Blinker_ledState_fetch(&val); | ||
433 | - Em_App_marshallToBuf(); | ||
434 | -#else | ||
435 | - Blinker_ledState_fetch((void*)Em_App_msg.data); | ||
436 | -#endif | ||
437 | - size = 1; | ||
438 | - break; | ||
439 | - } | ||
440 | - } | ||
441 | - Em_App_sendResponse(Em_Message_FETCH_DONE, size); | ||
442 | -} | ||
443 | - | ||
444 | -void Em_App_storeDispatch(void) { | ||
445 | - switch (Em_App_msg.hdr.resId) { | ||
446 | - case 0: { | ||
447 | - break; | ||
448 | - } | ||
449 | - case 1: { | ||
450 | -#ifdef Em_16BIT | ||
451 | - Blinker_cmd_t val; | ||
452 | - Em_App_valp = (uint8_t*)&val; | ||
453 | - Em_App_bufp = Em_App_msg.data; | ||
454 | - Em_App_desc = "1"; | ||
455 | - Em_App_marshallToVal(); | ||
456 | - Blinker_cmd_store(&val); | ||
457 | -#else | ||
458 | - Blinker_cmd_store((void*)Em_App_msg.data); | ||
459 | -#endif | ||
460 | - break; | ||
461 | - } | ||
462 | - case 2: { | ||
463 | -#ifdef Em_16BIT | ||
464 | - Blinker_count_t val; | ||
465 | - Em_App_valp = (uint8_t*)&val; | ||
466 | - Em_App_bufp = Em_App_msg.data; | ||
467 | - Em_App_desc = "2"; | ||
468 | - Em_App_marshallToVal(); | ||
469 | - Blinker_count_store(&val); | ||
470 | -#else | ||
471 | - Blinker_count_store((void*)Em_App_msg.data); | ||
472 | -#endif | ||
473 | - break; | ||
474 | - } | ||
475 | - case 3: { | ||
476 | -#ifdef Em_16BIT | ||
477 | - Blinker_delay_t val; | ||
478 | - Em_App_valp = (uint8_t*)&val; | ||
479 | - Em_App_bufp = Em_App_msg.data; | ||
480 | - Em_App_desc = "2"; | ||
481 | - Em_App_marshallToVal(); | ||
482 | - Blinker_delay_store(&val); | ||
483 | -#else | ||
484 | - Blinker_delay_store((void*)Em_App_msg.data); | ||
485 | -#endif | ||
486 | - break; | ||
487 | - } | ||
488 | - } | ||
489 | - Em_App_sendResponse(Em_Message_STORE_DONE, 0); | ||
490 | -} | ||
491 | - | ||
492 | -void Em_App_sendIndicator(Em_Message_ResId indId) { | ||
493 | - Em_Message_Size resId = 0; | ||
494 | - Em_Message_Size size = 0; | ||
495 | - switch (indId) { | ||
496 | - case 1: { | ||
497 | -#ifdef Em_16BIT | ||
498 | - Blinker_ledState_t val; | ||
499 | - Em_App_valp = (uint8_t*)&val; | ||
500 | - Em_App_bufp = Em_App_ind.data; | ||
501 | - Em_App_desc = "1"; | ||
502 | - Blinker_ledState_fetch(&val); | ||
503 | - Em_App_marshallToBuf(); | ||
504 | -#else | ||
505 | - Blinker_ledState_fetch((Blinker_ledState_t*)&Em_App_ind.data); | ||
506 | -#endif | ||
507 | - resId = 4; | ||
508 | - size = 1; | ||
509 | - break; | ||
510 | - } | ||
511 | - } | ||
512 | - Em_App_ind.sot = 0; | ||
513 | - Em_App_ind.hdr.kind = Em_Message_INDICATOR; | ||
514 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header) + size; | ||
515 | - Em_App_ind.hdr.resId = resId; | ||
516 | - Em_App_startIndSend(); | ||
517 | -} | ||
518 | - | ||
519 | -void Blinker_ledState_indicate(void) { | ||
520 | - if (Em_App_state == Em_App_CONNECTED && Em_App_xmitReady(1 + 1)) Em_App_sendIndicator(1); | ||
521 | -} | ||
522 | - | ||
523 | -#ifdef __cplusplus | ||
524 | -} | ||
525 | -#endif | ||
526 | - |
BlinkerSchema/Em/Blinker.h deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-14T16:24:37T ****/ | ||
2 | -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ | ||
3 | - | ||
4 | -#ifndef Blinker__H | ||
5 | -#define Blinker__H | ||
6 | - | ||
7 | -#include "Em_Types.h" | ||
8 | -#include "Em_Message.h" | ||
9 | - | ||
10 | -#ifdef __cplusplus | ||
11 | -extern "C" { | ||
12 | -#endif | ||
13 | - | ||
14 | -/* -------- connection callback functions implemented by the application -------- */ | ||
15 | - | ||
16 | -void Blinker_connectHandler(void); | ||
17 | -void Blinker_disconnectHandler(void); | ||
18 | - | ||
19 | -/* -------- resource types defined in the schema -------- */ | ||
20 | - | ||
21 | -/* enum Cmd */ | ||
22 | -typedef uint8_t Blinker_Cmd; | ||
23 | -#define Blinker_START_CMD 0 | ||
24 | -#define Blinker_STOP_CMD 1 | ||
25 | - | ||
26 | -/* enum LedState */ | ||
27 | -typedef uint8_t Blinker_LedState; | ||
28 | -#define Blinker_LED_OFF 0 | ||
29 | -#define Blinker_LED_ON 1 | ||
30 | - | ||
31 | -/* -------- resource callback functions implemented by the application -------- */ | ||
32 | - | ||
33 | -/* resource cmd */ | ||
34 | -typedef Blinker_Cmd Blinker_cmd_t; | ||
35 | -extern void Blinker_cmd_store(Blinker_cmd_t* input); | ||
36 | - | ||
37 | -/* resource count */ | ||
38 | -typedef int16_t Blinker_count_t; | ||
39 | -extern void Blinker_count_fetch(Blinker_count_t* output); | ||
40 | -extern void Blinker_count_store(Blinker_count_t* input); | ||
41 | - | ||
42 | -/* resource delay */ | ||
43 | -typedef uint16_t Blinker_delay_t; | ||
44 | -#define Blinker_delay_min 500 | ||
45 | -#define Blinker_delay_max 2000 | ||
46 | -#define Blinker_delay_step 100 | ||
47 | -#define Blinker_delay_scale 1000 | ||
48 | -extern void Blinker_delay_fetch(Blinker_delay_t* output); | ||
49 | -extern void Blinker_delay_store(Blinker_delay_t* input); | ||
50 | - | ||
51 | -/* resource ledState */ | ||
52 | -typedef Blinker_LedState Blinker_ledState_t; | ||
53 | -extern void Blinker_ledState_fetch(Blinker_ledState_t* output); | ||
54 | -extern void Blinker_ledState_indicate(void); /* called by the application */ | ||
55 | - | ||
56 | -/* -------- application functions implemented in Blinker.c -------- */ | ||
57 | - | ||
58 | -void Blinker_accept(bool enable); | ||
59 | -void Blinker_activateParameters(uint8_t group); | ||
60 | -void Blinker_broadcastOff(void); | ||
61 | -void Blinker_disconnect(void); | ||
62 | -void Blinker_pairingOn(uint8_t secs, void(*handler)(void)); | ||
63 | -void Blinker_pairingOff(void(*handler)(void)); | ||
64 | -void Blinker_reset(void); | ||
65 | -void Blinker_setDeviceName(const char* name); | ||
66 | -void Blinker_start(void); | ||
67 | - | ||
68 | -#ifdef __cplusplus | ||
69 | -} | ||
70 | -#endif | ||
71 | - | ||
72 | -#endif /* Blinker__H */ |
BlinkerSchema/Em/Em_Message.h deleted
1 | -#ifndef Em_Message_H_ | ||
2 | -#define Em_Message_H_ | ||
3 | - | ||
4 | -#include "Em_Types.h" | ||
5 | - | ||
6 | -#ifdef __cplusplus | ||
7 | -extern "C" { | ||
8 | -#endif | ||
9 | - | ||
10 | -/* -------- SRT FUNCTIONS CALLED BY HAL -------- */ | ||
11 | - | ||
12 | -static inline bool Em_Message_addByte(uint8_t b); | ||
13 | -extern void Em_Message_dispatch(void); | ||
14 | -static inline bool Em_Message_getByte(uint8_t* bp); | ||
15 | -extern void Em_Message_restart(void); | ||
16 | -static inline bool Em_Message_startRx(void); | ||
17 | -static inline uint8_t Em_Message_startTx(void); | ||
18 | - | ||
19 | - | ||
20 | -/* -------- HAL FUNCTIONS CALLED BY SRT -------- */ | ||
21 | - | ||
22 | -extern uint8_t Em_Hal_lock(void); | ||
23 | -extern void Em_Hal_reset(void); | ||
24 | -extern void Em_Hal_startSend(void); | ||
25 | -extern void Em_Hal_unlock(uint8_t key); | ||
26 | -extern void Em_Hal_watchOff(void); | ||
27 | -extern void Em_Hal_watchOn(void); | ||
28 | - | ||
29 | - | ||
30 | -/* -------- MESSAGE FORMAT -------- */ | ||
31 | - | ||
32 | -/* protocolLevel #4 */ | ||
33 | -#define Em_Message_INDSIZE 4 | ||
34 | - | ||
35 | -typedef uint8_t Em_Message_Size; | ||
36 | -typedef uint8_t Em_Message_Kind; | ||
37 | -/* protocolLevel #12 -- split 16-bit resId into <resId, chan> */ | ||
38 | -typedef uint8_t Em_Message_ResId; | ||
39 | -typedef uint8_t Em_Message_Chan; | ||
40 | - | ||
41 | -#define Em_Message_NOP 0 | ||
42 | -#define Em_Message_FETCH 1 | ||
43 | -#define Em_Message_FETCH_DONE 2 | ||
44 | -#define Em_Message_STORE 3 | ||
45 | -#define Em_Message_STORE_DONE 4 | ||
46 | -#define Em_Message_INDICATOR 5 | ||
47 | -#define Em_Message_CONNECT 6 | ||
48 | -#define Em_Message_DISCONNECT 7 | ||
49 | -#define Em_Message_ECHO 8 | ||
50 | -/* protocolLevel #3 */ | ||
51 | -/* protocolLevel #6 -- rename from BROADCAST to PAIRING */ | ||
52 | -#define Em_Message_PAIRING 9 | ||
53 | -#define Em_Message_PAIRING_DONE 10 | ||
54 | -/* protocolLevel #7 */ | ||
55 | -#define Em_Message_OFFLINE 11 | ||
56 | -/* protocolLevel #8 */ | ||
57 | -#define Em_Message_ACCEPT 12 | ||
58 | -/* protocolLevel #13 */ | ||
59 | -#define Em_Message_START 13 | ||
60 | -#define Em_Message_ACTIVE_PARAMS 14 | ||
61 | - | ||
62 | -typedef struct Em_Message_Header { | ||
63 | - Em_Message_Size size; | ||
64 | - Em_Message_Kind kind; | ||
65 | - Em_Message_ResId resId; | ||
66 | - Em_Message_Chan chan; | ||
67 | -} Em_Message_Header; | ||
68 | - | ||
69 | -typedef uint16_t Em_Message_protocolLevel_t; | ||
70 | - | ||
71 | -/* protocolLevel #1 */ | ||
72 | - | ||
73 | -/* protocolLevel #10 */ | ||
74 | -/* #define Em_Message_SYS_SCHEMA_UUID 0xFF */ | ||
75 | - | ||
76 | -#define Em_Message_SYS_MCM_PROTOCOL_LEVEL 0xFE | ||
77 | -#define Em_Message_SYS_EAP_PROTOCOL_LEVEL 0xFD | ||
78 | -#define Em_Message_SYS_EAP_BUILD_DATE 0xFC | ||
79 | - | ||
80 | -/* protocolLevel #2 */ | ||
81 | -#define Em_Message_SYS_FILE_INDEX_RESET 0xFB | ||
82 | - | ||
83 | -/* protocolLevel #5 */ | ||
84 | -#define Em_Message_SYS_SCHEMA_HASH 0xFA | ||
85 | - | ||
86 | -/* protocolLevel #7 */ | ||
87 | -#define Em_Message_SYS_RESOURCE_COUNT 0xF9 | ||
88 | - | ||
89 | -/* protocolLevel #9 */ | ||
90 | -#define Em_Message_SYS_MOBILE_RSSI 0xF8 | ||
91 | - | ||
92 | -/* protocolLevel #11 */ | ||
93 | -#define Em_Message_SYS_MCM_DISCONNECT 0xF7 | ||
94 | - | ||
95 | -/* protocolLevel #13a */ | ||
96 | -#define Em_Message_SYS_MCM_NAME 0xF5 | ||
97 | - | ||
98 | - | ||
99 | -/* -------- PRIVATE -------- */ | ||
100 | - | ||
101 | -extern void Em_Message_nextXmit(void); | ||
102 | - | ||
103 | -extern uint8_t* Em_App_inBuf; | ||
104 | -extern uint8_t* Em_App_outBuf; | ||
105 | -extern Em_Message_Size Em_App_xmitSize; | ||
106 | - | ||
107 | -extern uint8_t* _Em_Message_rxBuf; | ||
108 | -extern uint8_t _Em_Message_rxCnt; | ||
109 | - | ||
110 | -extern uint8_t* _Em_Message_txBuf; | ||
111 | -extern uint8_t _Em_Message_txCnt; | ||
112 | - | ||
113 | -static inline bool Em_Message_addByte(uint8_t b) { | ||
114 | - if (_Em_Message_rxCnt == 0) { | ||
115 | - if (b == 0) { | ||
116 | - return false; | ||
117 | - } | ||
118 | - _Em_Message_rxCnt = b; | ||
119 | - } | ||
120 | - *_Em_Message_rxBuf++ = b; | ||
121 | - if (--_Em_Message_rxCnt == 0) { | ||
122 | - _Em_Message_rxBuf = 0; | ||
123 | - if (_Em_Message_txBuf == 0) { | ||
124 | - Em_Hal_watchOff(); | ||
125 | - } | ||
126 | - return true; | ||
127 | - } | ||
128 | - else { | ||
129 | - return false; | ||
130 | - } | ||
131 | -} | ||
132 | - | ||
133 | -static inline bool Em_Message_getByte(uint8_t* bp) { | ||
134 | - if (_Em_Message_txBuf == 0) { | ||
135 | - return false; | ||
136 | - } | ||
137 | - if (_Em_Message_txCnt == 0) { | ||
138 | - _Em_Message_txCnt = *_Em_Message_txBuf + 1; | ||
139 | - } | ||
140 | - if (--_Em_Message_txCnt > 0) { | ||
141 | - *bp = *_Em_Message_txBuf++; | ||
142 | - return true; | ||
143 | - } | ||
144 | - else { | ||
145 | - _Em_Message_txBuf = 0; | ||
146 | - Em_App_xmitSize = 0; | ||
147 | - Em_Message_nextXmit(); | ||
148 | - if (_Em_Message_rxBuf == 0) { | ||
149 | - Em_Hal_watchOff(); | ||
150 | - } | ||
151 | - return false; | ||
152 | - } | ||
153 | -} | ||
154 | - | ||
155 | -static inline bool Em_Message_startRx(void) { | ||
156 | - if (_Em_Message_rxBuf == 0) { | ||
157 | - _Em_Message_rxBuf = Em_App_inBuf; | ||
158 | - if (_Em_Message_txBuf == 0) { | ||
159 | - Em_Hal_watchOn(); | ||
160 | - } | ||
161 | - return true; | ||
162 | - } | ||
163 | - else { | ||
164 | - return false; | ||
165 | - } | ||
166 | -} | ||
167 | - | ||
168 | -static inline uint8_t Em_Message_startTx(void) { | ||
169 | - _Em_Message_txBuf = Em_App_outBuf + 1; | ||
170 | - _Em_Message_txCnt = 0; | ||
171 | - if (_Em_Message_rxBuf == 0) { | ||
172 | - Em_Hal_watchOn(); | ||
173 | - } | ||
174 | - return 0; | ||
175 | -} | ||
176 | - | ||
177 | - | ||
178 | -#ifdef __cplusplus | ||
179 | -} | ||
180 | -#endif | ||
181 | - | ||
182 | -#endif /*Em_Message_H_*/ |
BlinkerSchema/Em/Em_Types.h deleted
1 | -#ifndef Em_Types_H_ | ||
2 | -#define Em_Types_H_ | ||
3 | - | ||
4 | -#ifndef Em_NOSTDBOOL | ||
5 | -#include <stdbool.h> | ||
6 | -#endif | ||
7 | - | ||
8 | -#ifndef Em_NOSTDINT | ||
9 | -#include <stdint.h> | ||
10 | -#endif | ||
11 | - | ||
12 | -#ifdef Em_16BIT | ||
13 | -typedef signed char int8_t; | ||
14 | -typedef unsigned char uint8_t; | ||
15 | -#endif | ||
16 | - | ||
17 | -#endif /*Em_Types_H_*/ |
BlinkerSchema/Em/blinker.json deleted
1 | -{ | ||
2 | - "resources": { | ||
3 | - "$eapProtocolLevel": { | ||
4 | - "id": -3, | ||
5 | - "align": 2, | ||
6 | - "attributes": {"readonly": true}, | ||
7 | - "type": "u2", | ||
8 | - "access": "r", | ||
9 | - "size": 2 | ||
10 | - }, | ||
11 | - "count": { | ||
12 | - "id": 2, | ||
13 | - "align": 2, | ||
14 | - "attributes": {"readwrite": true}, | ||
15 | - "type": "i2", | ||
16 | - "access": "rw", | ||
17 | - "size": 2 | ||
18 | - }, | ||
19 | - "$activeGroup": { | ||
20 | - "id": -10, | ||
21 | - "align": 1, | ||
22 | - "pack": 1, | ||
23 | - "attributes": {"readwrite": true}, | ||
24 | - "type": "E:system@emmoco.com.System/ParameterGroup", | ||
25 | - "access": "rw", | ||
26 | - "size": 1 | ||
27 | - }, | ||
28 | - "$mcmDisconnect": { | ||
29 | - "id": -9, | ||
30 | - "align": 1, | ||
31 | - "attributes": {"writeonly": true}, | ||
32 | - "type": "u1", | ||
33 | - "access": "w", | ||
34 | - "size": 1 | ||
35 | - }, | ||
36 | - "$eapBuildDate": { | ||
37 | - "dim": 8, | ||
38 | - "id": -4, | ||
39 | - "align": 1, | ||
40 | - "attributes": {"readonly": true}, | ||
41 | - "type": "A8:u1", | ||
42 | - "access": "r", | ||
43 | - "size": 8 | ||
44 | - }, | ||
45 | - "ledState": { | ||
46 | - "id": 4, | ||
47 | - "align": 1, | ||
48 | - "pack": 1, | ||
49 | - "attributes": { | ||
50 | - "indicator": true, | ||
51 | - "readonly": true | ||
52 | - }, | ||
53 | - "type": "E:@emmoco.com.Blinker/LedState", | ||
54 | - "access": "ir", | ||
55 | - "size": 1 | ||
56 | - }, | ||
57 | - "$resourceCount": { | ||
58 | - "id": -7, | ||
59 | - "align": 1, | ||
60 | - "attributes": {"readonly": true}, | ||
61 | - "type": "S:system@emmoco.com.System/ResourceCount", | ||
62 | - "access": "r", | ||
63 | - "size": 2 | ||
64 | - }, | ||
65 | - "$schemaHash": { | ||
66 | - "dim": 20, | ||
67 | - "id": -6, | ||
68 | - "align": 1, | ||
69 | - "attributes": {"readonly": true}, | ||
70 | - "type": "A20:u1", | ||
71 | - "access": "r", | ||
72 | - "size": 20 | ||
73 | - }, | ||
74 | - "cmd": { | ||
75 | - "id": 1, | ||
76 | - "align": 1, | ||
77 | - "pack": 1, | ||
78 | - "attributes": {"writeonly": true}, | ||
79 | - "type": "E:@emmoco.com.Blinker/Cmd", | ||
80 | - "access": "w", | ||
81 | - "size": 1 | ||
82 | - }, | ||
83 | - "$mcmProtocolLevel": { | ||
84 | - "id": -2, | ||
85 | - "align": 2, | ||
86 | - "attributes": {"readonly": true}, | ||
87 | - "type": "u2", | ||
88 | - "access": "r", | ||
89 | - "size": 2 | ||
90 | - }, | ||
91 | - "$mobileRssi": { | ||
92 | - "id": -8, | ||
93 | - "align": 1, | ||
94 | - "attributes": {"readonly": true}, | ||
95 | - "type": "i1", | ||
96 | - "access": "r", | ||
97 | - "size": 1 | ||
98 | - }, | ||
99 | - "delay": { | ||
100 | - "id": 3, | ||
101 | - "align": 2, | ||
102 | - "pack": 4, | ||
103 | - "attributes": {"readwrite": true}, | ||
104 | - "type": "N:0.500000,2.000000,0.100000,3/u2/15", | ||
105 | - "access": "rw", | ||
106 | - "size": 2 | ||
107 | - }, | ||
108 | - "$fileIndexReset": { | ||
109 | - "id": -5, | ||
110 | - "align": 2, | ||
111 | - "attributes": {"writeonly": true}, | ||
112 | - "type": "i2", | ||
113 | - "access": "w", | ||
114 | - "size": 2 | ||
115 | - } | ||
116 | - }, | ||
117 | - "resourceNamesSys": [ | ||
118 | - "$activeGroup", | ||
119 | - "$eapBuildDate", | ||
120 | - "$eapProtocolLevel", | ||
121 | - "$fileIndexReset", | ||
122 | - "$mcmDisconnect", | ||
123 | - "$mcmProtocolLevel", | ||
124 | - "$mobileRssi", | ||
125 | - "$resourceCount", | ||
126 | - "$schemaHash" | ||
127 | - ], | ||
128 | - "manifest": { | ||
129 | - "protocolLevel": 13, | ||
130 | - "hash": [ | ||
131 | - 252, | ||
132 | - 123, | ||
133 | - 209, | ||
134 | - 86, | ||
135 | - 230, | ||
136 | - 104, | ||
137 | - 211, | ||
138 | - 8, | ||
139 | - 40, | ||
140 | - 191, | ||
141 | - 19, | ||
142 | - 28, | ||
143 | - 180, | ||
144 | - 183, | ||
145 | - 223, | ||
146 | - 192 | ||
147 | - ], | ||
148 | - "toolVersion": "13.4.1.201311121909", | ||
149 | - "name": "Blinker", | ||
150 | - "$$md5": "fc7bd156e668d30828bf131cb4b7dfc0", | ||
151 | - "build": [ | ||
152 | - 24, | ||
153 | - 231, | ||
154 | - 30, | ||
155 | - 251, | ||
156 | - 69, | ||
157 | - 1, | ||
158 | - 0, | ||
159 | - 0 | ||
160 | - ], | ||
161 | - "date": "2014-05-14T16:24:37T", | ||
162 | - "maxAlign": 2, | ||
163 | - "maxSize": 20, | ||
164 | - "version": "1.0.0" | ||
165 | - }, | ||
166 | - "resourceNames": [ | ||
167 | - "cmd", | ||
168 | - "count", | ||
169 | - "delay", | ||
170 | - "ledState", | ||
171 | - "$mcmProtocolLevel", | ||
172 | - "$eapProtocolLevel", | ||
173 | - "$eapBuildDate", | ||
174 | - "$fileIndexReset", | ||
175 | - "$schemaHash", | ||
176 | - "$resourceCount", | ||
177 | - "$mobileRssi", | ||
178 | - "$mcmDisconnect", | ||
179 | - "$activeGroup" | ||
180 | - ], | ||
181 | - "attributes": { | ||
182 | - "description": "Blinker, the hello world program for mobile control", | ||
183 | - "version": "1.0.0" | ||
184 | - }, | ||
185 | - "resourceNamesApp": [ | ||
186 | - "cmd", | ||
187 | - "count", | ||
188 | - "delay", | ||
189 | - "ledState" | ||
190 | - ], | ||
191 | - "types": { | ||
192 | - "@emmoco.com.Blinker/LedState": { | ||
193 | - "values": [ | ||
194 | - "LED_OFF", | ||
195 | - "LED_ON" | ||
196 | - ], | ||
197 | - "align": 1, | ||
198 | - "pack": 1, | ||
199 | - "type": "E:@emmoco.com.Blinker/LedState", | ||
200 | - "size": 1 | ||
201 | - }, | ||
202 | - "system@emmoco.com.System/ResourceCount": { | ||
203 | - "packed": false, | ||
204 | - "align": 1, | ||
205 | - "type": "S:system@emmoco.com.System/ResourceCount", | ||
206 | - "size": 2, | ||
207 | - "fields": [ | ||
208 | - { | ||
209 | - "pad": 0, | ||
210 | - "align": 1, | ||
211 | - "name": "app", | ||
212 | - "type": "u1", | ||
213 | - "size": 1 | ||
214 | - }, | ||
215 | - { | ||
216 | - "pad": 0, | ||
217 | - "align": 1, | ||
218 | - "name": "sys", | ||
219 | - "type": "u1", | ||
220 | - "size": 1 | ||
221 | - } | ||
222 | - ] | ||
223 | - }, | ||
224 | - "std:i2": { | ||
225 | - "align": 2, | ||
226 | - "size": 2 | ||
227 | - }, | ||
228 | - "std:i1": { | ||
229 | - "align": 1, | ||
230 | - "size": 1 | ||
231 | - }, | ||
232 | - "std:u1": { | ||
233 | - "align": 1, | ||
234 | - "size": 1 | ||
235 | - }, | ||
236 | - "system@emmoco.com.System/ParameterGroup": { | ||
237 | - "values": [ | ||
238 | - "GROUP_A", | ||
239 | - "GROUP_B" | ||
240 | - ], | ||
241 | - "align": 1, | ||
242 | - "pack": 1, | ||
243 | - "type": "E:system@emmoco.com.System/ParameterGroup", | ||
244 | - "size": 1 | ||
245 | - }, | ||
246 | - "@emmoco.com.Blinker/Cmd": { | ||
247 | - "values": [ | ||
248 | - "START_CMD", | ||
249 | - "STOP_CMD" | ||
250 | - ], | ||
251 | - "align": 1, | ||
252 | - "pack": 1, | ||
253 | - "type": "E:@emmoco.com.Blinker/Cmd", | ||
254 | - "size": 1 | ||
255 | - }, | ||
256 | - "std:u2": { | ||
257 | - "align": 2, | ||
258 | - "size": 2 | ||
259 | - } | ||
260 | - }, | ||
261 | - "imports": {"@emmoco.com.Blinker": true} | ||
262 | -} | ||
263 | \ No newline at end of file | 0 | \ No newline at end of file |
BlinkerSchema/Schema-Imports/system@emmoco.com/System.ems deleted
1 | -owner = "system@emmoco.com" | ||
2 | - | ||
3 | -schema System { | ||
4 | - | ||
5 | - // protocolLevel #13 | ||
6 | - | ||
7 | - enum ParameterGroup { | ||
8 | - GROUP_A, GROUP_B | ||
9 | - } | ||
10 | - | ||
11 | - // protocolLevel #1 | ||
12 | - | ||
13 | - uint8 $schemaUuid[16] { // protocolLevel #10 -- invisible to applications | ||
14 | - readonly | ||
15 | - } | ||
16 | - | ||
17 | - uint16 $mcmProtocolLevel { | ||
18 | - readonly | ||
19 | - } | ||
20 | - | ||
21 | - uint16 $eapProtocolLevel { | ||
22 | - readonly | ||
23 | - } | ||
24 | - | ||
25 | - uint8 $eapBuildDate[8] { // protocolLevel #5 -- rename from $eapBuildNumber | ||
26 | - readonly | ||
27 | - } | ||
28 | - | ||
29 | - // protocolLevel #2 | ||
30 | - | ||
31 | - int16 $fileIndexReset { | ||
32 | - writeonly | ||
33 | - } | ||
34 | - | ||
35 | - // protocolLevel #5 | ||
36 | - | ||
37 | - // protocolLevel #12 -- increase size to 20 | ||
38 | - | ||
39 | - uint8 $schemaHash[20] { | ||
40 | - readonly | ||
41 | - } | ||
42 | - | ||
43 | - // protocolLevel #7 | ||
44 | - | ||
45 | - struct ResourceCount { | ||
46 | - uint8 app | ||
47 | - uint8 sys | ||
48 | - } | ||
49 | - | ||
50 | - ResourceCount $resourceCount { | ||
51 | - readonly | ||
52 | - } | ||
53 | - | ||
54 | - // protocolLevel #9 | ||
55 | - | ||
56 | - int8 $mobileRssi { | ||
57 | - readonly | ||
58 | - } | ||
59 | - | ||
60 | - // protocolLevel #11 | ||
61 | - | ||
62 | - uint8 $mcmDisconnect { | ||
63 | - writeonly | ||
64 | - } | ||
65 | - | ||
66 | - // protocolLevel #13 | ||
67 | - | ||
68 | - ParameterGroup $activeGroup { | ||
69 | - readwrite | ||
70 | - } | ||
71 | - | ||
72 | -} |
BlinkerSchema/bundle.properties deleted
1 | -# generated file - do not edit | ||
2 | - | ||
3 | -bundle.requires = com.emmoco.schema.translator | ||
4 | -com.emmoco.framework.Properties.applicationDirectory = Em | ||
5 | -com.emmoco.framework.Properties.schemaDestinationDirectory = Em | ||
6 | -com.emmoco.framework.Properties.serverAPIToken = | ||
7 | -com.emmoco.framework.Properties.align16 = 2 | ||
8 | -com.emmoco.framework.Properties.align32 = 4 | ||
9 | -com.emmoco.framework.Properties.schemaFile = /Users/imanol/devel/durex/BlinkerSchema/schema.ems | ||
10 | -com.emmoco.framework.Properties.toolVersion = 13.4.1.201311121909 |
BlinkerSchema/imports/system@emmoco.com/System.ems deleted
1 | -owner = "system@emmoco.com" | ||
2 | - | ||
3 | -schema System { | ||
4 | - | ||
5 | - // protocolLevel #1 | ||
6 | - | ||
7 | - uint8 $schemaUuid[16] { // protocolLevel #10 -- invisible to applications | ||
8 | - readonly | ||
9 | - } | ||
10 | - | ||
11 | - uint16 $mcmProtocolLevel { | ||
12 | - readonly | ||
13 | - } | ||
14 | - | ||
15 | - uint16 $eapProtocolLevel { | ||
16 | - readonly | ||
17 | - } | ||
18 | - | ||
19 | - uint8 $eapBuildDate[8] { // protocolLevel #5 -- rename from $eapBuildNumber | ||
20 | - readonly | ||
21 | - } | ||
22 | - | ||
23 | - // protocolLevel #2 | ||
24 | - | ||
25 | - int16 $fileIndexReset { | ||
26 | - writeonly | ||
27 | - } | ||
28 | - | ||
29 | - // protocolLevel #5 | ||
30 | - | ||
31 | - // protocolLevel #12 -- increase size to 20 | ||
32 | - | ||
33 | - uint8 $schemaHash[20] { | ||
34 | - readonly | ||
35 | - } | ||
36 | - | ||
37 | - // protocolLevel #7 | ||
38 | - | ||
39 | - struct ResourceCount { | ||
40 | - uint8 app | ||
41 | - uint8 sys | ||
42 | - } | ||
43 | - | ||
44 | - ResourceCount $resourceCount { | ||
45 | - readonly | ||
46 | - } | ||
47 | - | ||
48 | - // protocolLevel #9 | ||
49 | - | ||
50 | - int8 $mobileRssi { | ||
51 | - readonly | ||
52 | - } | ||
53 | - | ||
54 | - // protocolLevel #11 | ||
55 | - | ||
56 | - uint8 $mcmDisconnect { | ||
57 | - writeonly | ||
58 | - } | ||
59 | - | ||
60 | -} |
BlinkerSchema/out/Blinker-TODO.c deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-10T00:12:31T ****/ | ||
2 | -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ | ||
3 | - | ||
4 | -#include "Blinker.h" | ||
5 | - | ||
6 | -#ifdef Em_Blinker_TODO /* enables optional inclusion of empty functions */ | ||
7 | - | ||
8 | -/* Copy the function skeletons below into your own Blinker.c source file */ | ||
9 | - | ||
10 | -void Blinker_connectHandler(void) { | ||
11 | - /* TODO: application is now connected */ | ||
12 | -} | ||
13 | - | ||
14 | -void Blinker_disconnectHandler(void) { | ||
15 | - /* TODO: application is now disconnected */ | ||
16 | -} | ||
17 | - | ||
18 | -void Blinker_cmd_store(Blinker_cmd_t* const input) { | ||
19 | - /* TODO: read resource 'cmd' from 'input' */ | ||
20 | -} | ||
21 | - | ||
22 | -void Blinker_count_fetch(Blinker_count_t* const output) { | ||
23 | - /* TODO: write resource 'count' into 'output' */ | ||
24 | -} | ||
25 | - | ||
26 | -void Blinker_count_store(Blinker_count_t* const input) { | ||
27 | - /* TODO: read resource 'count' from 'input' */ | ||
28 | -} | ||
29 | - | ||
30 | -void Blinker_delay_fetch(Blinker_delay_t* const output) { | ||
31 | - /* TODO: write resource 'delay' into 'output' */ | ||
32 | -} | ||
33 | - | ||
34 | -void Blinker_delay_store(Blinker_delay_t* const input) { | ||
35 | - /* TODO: read resource 'delay' from 'input' */ | ||
36 | -} | ||
37 | - | ||
38 | -void Blinker_ledState_fetch(Blinker_ledState_t* const output) { | ||
39 | - /* TODO: write resource 'ledState' into 'output' */ | ||
40 | -} | ||
41 | - | ||
42 | -#endif /* dummy file */ |
BlinkerSchema/out/Blinker.c deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-10T00:12:31T ****/ | ||
2 | -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ | ||
3 | - | ||
4 | -#include "Em_Message.h" | ||
5 | -#include "Blinker.h" | ||
6 | - | ||
7 | -#ifdef __cplusplus | ||
8 | -extern "C" { | ||
9 | -#endif | ||
10 | - | ||
11 | -#define Em_Message_protocolLevel 12 | ||
12 | - | ||
13 | -typedef struct Em_App_Message { | ||
14 | - uint8_t dummy; | ||
15 | - uint8_t sot; | ||
16 | - Em_Message_Header hdr; | ||
17 | - uint8_t data[20]; | ||
18 | -} Em_App_Message; | ||
19 | - | ||
20 | -const uint8_t Em_App_hash[] = {194, 8, 191, 173, 237, 198, 193, 165, 88, 202, 74, 246, 70, 59, 102, 128, 12, 0, ((sizeof(struct{uint8_t f1; uint16_t f2;}) - sizeof(uint16_t)) << 4) | (sizeof(struct{uint8_t f1; uint32_t f2;}) - sizeof(uint32_t))}; | ||
21 | - | ||
22 | -const uint8_t Em_App_build[] = {70, 123, 11, 227, 69, 1, 0, 0}; | ||
23 | - | ||
24 | -#define Em_App_APP_RESOURCE_COUNT 4 | ||
25 | -#define Em_App_SYS_RESOURCE_COUNT 8 | ||
26 | - | ||
27 | -#define Em_App_ACCEPT Blinker_accept | ||
28 | -#define Em_App_DISCONNECT Blinker_disconnect | ||
29 | -#define Em_App_PAIRINGON Blinker_pairingOn | ||
30 | -#define Em_App_PAIRINGOFF Blinker_pairingOff | ||
31 | -#define Em_App_RESET Blinker_reset | ||
32 | -#define Em_App_RUN Blinker_run | ||
33 | - | ||
34 | -#define Em_App_CONNECTHANDLER Blinker_connectHandler | ||
35 | -#define Em_App_DISCONNECTHANDLER Blinker_disconnectHandler | ||
36 | - | ||
37 | -#define Em_App_MAX_INDICATOR 2 | ||
38 | - | ||
39 | -enum {Em_App_IDLE, Em_App_DISCONNECTED, Em_App_CONNECTED}; | ||
40 | - | ||
41 | -typedef struct Em_App_Indicator { | ||
42 | - uint8_t dummy; | ||
43 | - uint8_t sot; | ||
44 | - Em_Message_Header hdr; | ||
45 | - uint8_t data[Em_Message_INDSIZE]; | ||
46 | -} Em_App_Indicator; | ||
47 | - | ||
48 | -void (*Em_App_pdHdlr)(void); | ||
49 | - | ||
50 | -const uint16_t Em_App_endian = 0x0100; | ||
51 | - | ||
52 | -Em_Message_Size Em_App_recvIdx; | ||
53 | -Em_Message_Size Em_App_recvSize; | ||
54 | -Em_Message_Size Em_App_xmitIdx; | ||
55 | -Em_Message_Size Em_App_xmitSize; | ||
56 | - | ||
57 | -uint8_t Em_App_state = Em_App_IDLE; | ||
58 | -Em_App_Message Em_App_msg; | ||
59 | -Em_App_Indicator Em_App_ind; | ||
60 | -bool Em_App_moreData = false; | ||
61 | -bool Em_App_readIdle = true; | ||
62 | -int32_t Em_App_fileIndex; | ||
63 | -uint32_t Em_App_xmitMask; | ||
64 | - | ||
65 | -uint8_t* Em_App_inBuf = (uint8_t*)&Em_App_msg.hdr; | ||
66 | -uint8_t* Em_App_outBuf; | ||
67 | - | ||
68 | -void Em_App_fetchDispatch(void); | ||
69 | -void Em_App_storeDispatch(void); | ||
70 | -void Em_App_sendIndicator(Em_Message_ResId indId); | ||
71 | -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size); | ||
72 | -void Em_App_startIndSend(void); | ||
73 | -void Em_App_startResSend(void); | ||
74 | -void Em_App_sysFetchDispatch(void); | ||
75 | -void Em_App_sysStoreDispatch(void); | ||
76 | -bool Em_App_xmitReady(Em_Message_ResId indId); | ||
77 | - | ||
78 | -bool Em_Message_addByte(uint8_t b) { | ||
79 | - if (Em_App_readIdle && b) { | ||
80 | - Em_App_recvSize = Em_App_inBuf[0] = b; | ||
81 | - Em_App_recvIdx = 1; | ||
82 | - Em_App_readIdle = false; | ||
83 | - return false; | ||
84 | - } | ||
85 | - Em_App_inBuf[Em_App_recvIdx++] = b; | ||
86 | - if (Em_App_recvIdx < Em_App_recvSize) { | ||
87 | - return false; | ||
88 | - } | ||
89 | - Em_App_readIdle = true; | ||
90 | - return true; | ||
91 | -} | ||
92 | - | ||
93 | -bool Em_Message_getByte(uint8_t* bp) { | ||
94 | - uint8_t key = Em_Message_lock(); | ||
95 | - Em_App_moreData = (Em_App_xmitSize != 0); | ||
96 | - if (!Em_App_moreData && (Em_App_xmitMask != 0)) { | ||
97 | - uint8_t i; | ||
98 | - uint32_t m; | ||
99 | - for (i = 0, m = 0x1; i < Em_App_MAX_INDICATOR; i++, m <<= 1) { | ||
100 | - if (Em_App_xmitMask & m) { | ||
101 | - Em_App_xmitMask &= ~m; | ||
102 | - if (i == 0) { | ||
103 | - Em_App_startResSend(); | ||
104 | - } | ||
105 | - else { | ||
106 | - Em_App_sendIndicator(i); | ||
107 | - } | ||
108 | - break; | ||
109 | - } | ||
110 | - } | ||
111 | - Em_Message_unlock(key); | ||
112 | - return false; | ||
113 | - } | ||
114 | - else if (Em_App_moreData) { | ||
115 | - *bp = Em_App_outBuf[Em_App_xmitIdx++]; | ||
116 | - Em_App_xmitSize -= 1; | ||
117 | - } | ||
118 | - Em_Message_unlock(key); | ||
119 | - return Em_App_moreData; | ||
120 | -} | ||
121 | - | ||
122 | -void Em_App_ACCEPT(bool enable) { | ||
123 | - if (Em_App_state == Em_App_CONNECTED) { | ||
124 | - return; | ||
125 | - } | ||
126 | - Em_App_ind.sot = 0; | ||
127 | - Em_App_ind.hdr.kind = Em_Message_ACCEPT; | ||
128 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
129 | - Em_App_ind.hdr.resId = enable; | ||
130 | - Em_App_startIndSend(); | ||
131 | -} | ||
132 | - | ||
133 | -void Em_App_DISCONNECT(void) { | ||
134 | - if (Em_App_state != Em_App_CONNECTED) { | ||
135 | - return; | ||
136 | - } | ||
137 | - Em_App_state = Em_App_DISCONNECTED; | ||
138 | - Em_App_ind.sot = 0; | ||
139 | - Em_App_ind.hdr.kind = Em_Message_DISCONNECT; | ||
140 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
141 | - Em_App_ind.hdr.resId = 0; | ||
142 | - Em_App_startIndSend(); | ||
143 | -} | ||
144 | - | ||
145 | -void Em_Message_dispatch(void) { | ||
146 | - if (Em_App_state == Em_App_IDLE) { | ||
147 | - return; | ||
148 | - } | ||
149 | - switch (Em_App_msg.hdr.kind) { | ||
150 | - case Em_Message_CONNECT: | ||
151 | - Em_App_state = Em_App_CONNECTED; | ||
152 | - Em_App_CONNECTHANDLER(); | ||
153 | - break; | ||
154 | - case Em_Message_DISCONNECT: | ||
155 | - Em_App_state = Em_App_DISCONNECTED; | ||
156 | - Em_App_DISCONNECTHANDLER(); | ||
157 | - break; | ||
158 | - case Em_Message_PAIRING_DONE: | ||
159 | - if (Em_App_pdHdlr) { | ||
160 | - (*Em_App_pdHdlr)(); | ||
161 | - } | ||
162 | - break; | ||
163 | - case Em_Message_FETCH: | ||
164 | - if (Em_App_msg.hdr.resId > 0) { | ||
165 | - Em_App_fetchDispatch(); | ||
166 | - } | ||
167 | - else { | ||
168 | - Em_App_sysFetchDispatch(); | ||
169 | - } | ||
170 | - break; | ||
171 | - case Em_Message_STORE: | ||
172 | - if (Em_App_msg.hdr.resId > 0) { | ||
173 | - Em_App_storeDispatch(); | ||
174 | - } | ||
175 | - else { | ||
176 | - Em_App_sysStoreDispatch(); | ||
177 | - } | ||
178 | - break; | ||
179 | - } | ||
180 | -} | ||
181 | - | ||
182 | -void Em_App_PAIRINGOFF(void(*handler)(void)) { | ||
183 | - Em_App_PAIRINGON(0, handler); | ||
184 | -} | ||
185 | - | ||
186 | -void Em_App_PAIRINGON(uint8_t secs, void(*handler)(void)) { | ||
187 | - if (Em_App_state != Em_App_DISCONNECTED) { | ||
188 | - return; | ||
189 | - } | ||
190 | - Em_App_pdHdlr = handler; | ||
191 | - Em_App_ind.sot = 0; | ||
192 | - Em_App_ind.hdr.kind = Em_Message_PAIRING; | ||
193 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
194 | - Em_App_ind.hdr.resId = secs; | ||
195 | - Em_App_startIndSend(); | ||
196 | -} | ||
197 | - | ||
198 | -void Em_App_RESET(void) { | ||
199 | - Em_App_recvIdx = Em_App_recvSize = Em_App_xmitIdx = Em_App_xmitSize = 0; | ||
200 | - Em_App_state = Em_App_IDLE; | ||
201 | - Em_App_moreData = false; | ||
202 | - Em_App_readIdle = true; | ||
203 | - Em_App_fileIndex = 0; | ||
204 | - Em_App_xmitMask = 0; | ||
205 | -} | ||
206 | - | ||
207 | -void Em_App_RUN(void) { | ||
208 | - Em_App_state = Em_App_DISCONNECTED; | ||
209 | -} | ||
210 | - | ||
211 | -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size) { | ||
212 | - if (Em_App_state != Em_App_CONNECTED) { | ||
213 | - return; | ||
214 | - } | ||
215 | - Em_App_msg.sot = 0; | ||
216 | - Em_App_msg.hdr.kind = kind; | ||
217 | - Em_App_msg.hdr.size = size + sizeof (Em_Message_Header); | ||
218 | - if (Em_App_xmitReady(0)) { | ||
219 | - Em_App_startResSend(); | ||
220 | - } | ||
221 | -} | ||
222 | - | ||
223 | -void Em_App_startIndSend(void) { | ||
224 | - Em_App_outBuf = (uint8_t*)&Em_App_ind.sot; | ||
225 | - Em_App_xmitSize = Em_App_ind.hdr.size + 1; | ||
226 | - Em_App_xmitIdx = 0; | ||
227 | - Em_Message_startSend(); | ||
228 | -} | ||
229 | - | ||
230 | -void Em_App_startResSend(void) { | ||
231 | - Em_App_outBuf = (uint8_t*)&Em_App_msg.sot; | ||
232 | - Em_App_xmitSize = Em_App_msg.hdr.size + 1; | ||
233 | - Em_App_xmitIdx = 0; | ||
234 | - Em_Message_startSend(); | ||
235 | -} | ||
236 | - | ||
237 | -void Em_App_sysFetchDispatch(void) { | ||
238 | - uint8_t size = 0; | ||
239 | - int i; | ||
240 | - switch (Em_App_msg.hdr.resId) { | ||
241 | - case Em_Message_SYS_SCHEMA_HASH: | ||
242 | - for (i = 0; i < sizeof (Em_App_hash); i++) { | ||
243 | - Em_App_msg.data[i] = Em_App_hash[i]; | ||
244 | - } | ||
245 | - Em_App_msg.data[sizeof (Em_App_hash)] = *((uint8_t*)&Em_App_endian); | ||
246 | - size = sizeof (Em_App_hash) + 1; | ||
247 | - break; | ||
248 | - case Em_Message_SYS_EAP_PROTOCOL_LEVEL: | ||
249 | - *((Em_Message_protocolLevel_t*)Em_App_msg.data) = Em_Message_protocolLevel; | ||
250 | - size = sizeof (Em_Message_protocolLevel_t); | ||
251 | - break; | ||
252 | - case Em_Message_SYS_EAP_BUILD_DATE: | ||
253 | - for (i = 0; i < sizeof (Em_App_build); i++) { | ||
254 | - Em_App_msg.data[i] = Em_App_build[i]; | ||
255 | - } | ||
256 | - size = sizeof (Em_App_build); | ||
257 | - break; | ||
258 | - case Em_Message_SYS_RESOURCE_COUNT: | ||
259 | - Em_App_msg.data[0] = Em_App_APP_RESOURCE_COUNT; | ||
260 | - Em_App_msg.data[1] = Em_App_SYS_RESOURCE_COUNT; | ||
261 | - size = 2; | ||
262 | - break; | ||
263 | - } | ||
264 | - Em_App_sendResponse(Em_Message_FETCH_DONE, size); | ||
265 | -} | ||
266 | - | ||
267 | -void Em_App_sysStoreDispatch(void) { | ||
268 | - switch (Em_App_msg.hdr.resId) { | ||
269 | - case Em_Message_SYS_FILE_INDEX_RESET: | ||
270 | - Em_App_fileIndex = 0; | ||
271 | - break; | ||
272 | - } | ||
273 | - Em_App_sendResponse(Em_Message_STORE_DONE, 0); | ||
274 | -} | ||
275 | - | ||
276 | -bool Em_App_xmitReady(Em_Message_ResId indId) { | ||
277 | - uint8_t key = Em_Message_lock(); | ||
278 | - bool res = !Em_App_moreData && Em_App_xmitMask == 0; | ||
279 | - if (!res) { | ||
280 | - Em_App_xmitMask |= (1 << indId); | ||
281 | - } | ||
282 | - Em_Message_unlock(key); | ||
283 | - return res; | ||
284 | -} | ||
285 | - | ||
286 | -void Em_App_fetchDispatch(void) { | ||
287 | - uint8_t size = 0; | ||
288 | - switch (Em_App_msg.hdr.resId) { | ||
289 | - case 0: | ||
290 | - break; | ||
291 | - case 2: | ||
292 | - Blinker_count_fetch((Blinker_count_t*)Em_App_msg.data); | ||
293 | - size = 2; | ||
294 | - break; | ||
295 | - case 3: | ||
296 | - Blinker_delay_fetch((Blinker_delay_t*)Em_App_msg.data); | ||
297 | - size = 2; | ||
298 | - break; | ||
299 | - case 4: | ||
300 | - Blinker_ledState_fetch((Blinker_ledState_t*)Em_App_msg.data); | ||
301 | - size = 1; | ||
302 | - break; | ||
303 | - } | ||
304 | - Em_App_sendResponse(Em_Message_FETCH_DONE, size); | ||
305 | -} | ||
306 | - | ||
307 | -void Em_App_storeDispatch(void) { | ||
308 | - switch (Em_App_msg.hdr.resId) { | ||
309 | - case 0: | ||
310 | - break; | ||
311 | - case 1: | ||
312 | - Blinker_cmd_store((Blinker_cmd_t*)Em_App_msg.data); | ||
313 | - break; | ||
314 | - case 2: | ||
315 | - Blinker_count_store((Blinker_count_t*)Em_App_msg.data); | ||
316 | - break; | ||
317 | - case 3: | ||
318 | - Blinker_delay_store((Blinker_delay_t*)Em_App_msg.data); | ||
319 | - break; | ||
320 | - } | ||
321 | - Em_App_sendResponse(Em_Message_STORE_DONE, 0); | ||
322 | -} | ||
323 | - | ||
324 | -void Em_App_sendIndicator(Em_Message_ResId indId) { | ||
325 | - Em_Message_Size resId = 0; | ||
326 | - Em_Message_Size size = 0; | ||
327 | - switch (indId) { | ||
328 | - case 1: | ||
329 | - Blinker_ledState_fetch((Blinker_ledState_t*)&Em_App_ind.data); | ||
330 | - resId = 4; | ||
331 | - size = 1; | ||
332 | - break; | ||
333 | -} | ||
334 | - Em_App_ind.sot = 0; | ||
335 | - Em_App_ind.hdr.kind = Em_Message_INDICATOR; | ||
336 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header) + size; | ||
337 | - Em_App_ind.hdr.resId = resId; | ||
338 | - Em_App_startIndSend(); | ||
339 | -} | ||
340 | - | ||
341 | -void Blinker_ledState_indicate(void) { | ||
342 | - if (Em_App_state != Em_App_IDLE && Em_App_xmitReady(1)) Em_App_sendIndicator(1); | ||
343 | -} | ||
344 | - | ||
345 | -#ifdef __cplusplus | ||
346 | -} | ||
347 | -#endif | ||
348 | - |
BlinkerSchema/out/Blinker.h deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.Blinker on 2014-05-10T00:12:31T ****/ | ||
2 | -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ | ||
3 | - | ||
4 | -#ifndef Blinker__H | ||
5 | -#define Blinker__H | ||
6 | - | ||
7 | -#include "Em_Types.h" | ||
8 | -#include "Em_Message.h" | ||
9 | - | ||
10 | -#ifdef __cplusplus | ||
11 | -extern "C" { | ||
12 | -#endif | ||
13 | - | ||
14 | -/* enum Cmd */ | ||
15 | -typedef uint8_t Blinker_Cmd; | ||
16 | -#define Blinker_START_CMD 0 | ||
17 | -#define Blinker_STOP_CMD 1 | ||
18 | - | ||
19 | -/* enum LedState */ | ||
20 | -typedef uint8_t Blinker_LedState; | ||
21 | -#define Blinker_LED_OFF 0 | ||
22 | -#define Blinker_LED_ON 1 | ||
23 | - | ||
24 | -/* resource cmd */ | ||
25 | -typedef Blinker_Cmd Blinker_cmd_t; | ||
26 | -extern void Blinker_cmd_store(Blinker_cmd_t* const input); | ||
27 | - | ||
28 | -/* resource count */ | ||
29 | -typedef int16_t Blinker_count_t; | ||
30 | -extern void Blinker_count_fetch(Blinker_count_t* const output); | ||
31 | -extern void Blinker_count_store(Blinker_count_t* const input); | ||
32 | - | ||
33 | -/* resource delay */ | ||
34 | -typedef uint16_t Blinker_delay_t; | ||
35 | -#define Blinker_delay_min 500 | ||
36 | -#define Blinker_delay_max 2000 | ||
37 | -#define Blinker_delay_step 100 | ||
38 | -extern void Blinker_delay_fetch(Blinker_delay_t* const output); | ||
39 | -extern void Blinker_delay_store(Blinker_delay_t* const input); | ||
40 | - | ||
41 | -/* resource ledState */ | ||
42 | -typedef Blinker_LedState Blinker_ledState_t; | ||
43 | -extern void Blinker_ledState_fetch(Blinker_ledState_t* const output); | ||
44 | -extern void Blinker_ledState_indicate(void); | ||
45 | - | ||
46 | -void Blinker_reset(void); | ||
47 | -void Blinker_run(void); | ||
48 | - | ||
49 | -void Blinker_accept(bool enable); | ||
50 | -void Blinker_disconnect(void); | ||
51 | -void Blinker_pairingOn(uint8_t secs, void(*handler)(void)); | ||
52 | -void Blinker_pairingOff(void(*handler)(void)); | ||
53 | - | ||
54 | -void Blinker_connectHandler(void); | ||
55 | -void Blinker_disconnectHandler(void); | ||
56 | - | ||
57 | -#ifdef __cplusplus | ||
58 | -} | ||
59 | -#endif | ||
60 | - | ||
61 | -#endif /* Blinker__H */ |
BlinkerSchema/out/Blinker.zip deleted
No preview for this file type
BlinkerSchema/out/Em_Message.h deleted
1 | -#ifndef Em_Message_H_ | ||
2 | -#define Em_Message_H_ | ||
3 | - | ||
4 | -#include "Em_Types.h" | ||
5 | - | ||
6 | -#ifdef __cplusplus | ||
7 | -extern "C" { | ||
8 | -#endif | ||
9 | - | ||
10 | -/* protocolLevel #4 */ | ||
11 | -#define Em_Message_INDSIZE 4 | ||
12 | - | ||
13 | -typedef uint8_t Em_Message_Size; | ||
14 | -typedef uint8_t Em_Message_Kind; | ||
15 | -/* protocolLevel #12 -- split 16-bit resId into <resId, chan> */ | ||
16 | -typedef int8_t Em_Message_ResId; | ||
17 | -typedef uint8_t Em_Message_Chan; | ||
18 | - | ||
19 | -#define Em_Message_NOP 0 | ||
20 | -#define Em_Message_FETCH 1 | ||
21 | -#define Em_Message_FETCH_DONE 2 | ||
22 | -#define Em_Message_STORE 3 | ||
23 | -#define Em_Message_STORE_DONE 4 | ||
24 | -#define Em_Message_INDICATOR 5 | ||
25 | -#define Em_Message_CONNECT 6 | ||
26 | -#define Em_Message_DISCONNECT 7 | ||
27 | -#define Em_Message_ECHO 8 | ||
28 | -/* protocolLevel #3 */ | ||
29 | -/* protocolLevel #6 -- rename from BROADCAST to PAIRING */ | ||
30 | -#define Em_Message_PAIRING 9 | ||
31 | -#define Em_Message_PAIRING_DONE 10 | ||
32 | -/* protocolLevel #7 */ | ||
33 | -#define Em_Message_OFFLINE 11 | ||
34 | -/* protocolLevel #8 */ | ||
35 | -#define Em_Message_ACCEPT 12 | ||
36 | - | ||
37 | -typedef struct Em_Message_Header { | ||
38 | - Em_Message_Size size; | ||
39 | - Em_Message_Kind kind; | ||
40 | - Em_Message_ResId resId; | ||
41 | - Em_Message_Chan chan; | ||
42 | -} Em_Message_Header; | ||
43 | - | ||
44 | -typedef uint16_t Em_Message_protocolLevel_t; | ||
45 | - | ||
46 | -/* protocolLevel #1 */ | ||
47 | - | ||
48 | -/* protocolLevel #10 */ | ||
49 | -/* #define Em_Message_SYS_SCHEMA_UUID -1 */ | ||
50 | - | ||
51 | -#define Em_Message_SYS_MCM_PROTOCOL_LEVEL -2 | ||
52 | -#define Em_Message_SYS_EAP_PROTOCOL_LEVEL -3 | ||
53 | -#define Em_Message_SYS_EAP_BUILD_DATE -4 | ||
54 | - | ||
55 | -/* protocolLevel #2 */ | ||
56 | -#define Em_Message_SYS_FILE_INDEX_RESET -5 | ||
57 | - | ||
58 | -/* protocolLevel #5 */ | ||
59 | -#define Em_Message_SYS_SCHEMA_HASH -6 | ||
60 | - | ||
61 | -/* protocolLevel #7 */ | ||
62 | -#define Em_Message_SYS_RESOURCE_COUNT -7 | ||
63 | - | ||
64 | -/* protocolLevel #9 */ | ||
65 | -#define Em_Message_SYS_MOBILE_RSSI -8 | ||
66 | - | ||
67 | -/* protocolLevel #11 */ | ||
68 | -#define Em_Message_SYS_MCM_DISCONNECT -9 | ||
69 | - | ||
70 | -extern void Em_Message_init(void); | ||
71 | - | ||
72 | -extern bool Em_Message_addByte(uint8_t b); | ||
73 | -extern void Em_Message_dispatch(void); | ||
74 | -extern bool Em_Message_getByte(uint8_t *bp); | ||
75 | -extern uint8_t Em_Message_lock(void); | ||
76 | -extern void Em_Message_startSend(void); | ||
77 | -extern void Em_Message_unlock(uint8_t key); | ||
78 | - | ||
79 | -#ifdef __cplusplus | ||
80 | -} | ||
81 | -#endif | ||
82 | - | ||
83 | -#endif /*Em_Message_H_*/ |
BlinkerSchema/out/Em_Types.h deleted
BlinkerSchema/out/blinker.json deleted
1 | -{ | ||
2 | - "resources": { | ||
3 | - "$schemaHash": { | ||
4 | - "id": -6, | ||
5 | - "align": 1, | ||
6 | - "attributes": {"readonly": true}, | ||
7 | - "type": "A20:u1", | ||
8 | - "access": "r", | ||
9 | - "size": 20 | ||
10 | - }, | ||
11 | - "$eapProtocolLevel": { | ||
12 | - "id": -3, | ||
13 | - "align": 2, | ||
14 | - "attributes": {"readonly": true}, | ||
15 | - "type": "u2", | ||
16 | - "access": "r", | ||
17 | - "size": 2 | ||
18 | - }, | ||
19 | - "cmd": { | ||
20 | - "id": 1, | ||
21 | - "align": 1, | ||
22 | - "attributes": {"writeonly": true}, | ||
23 | - "type": "E:@emmoco.com.Blinker/Cmd", | ||
24 | - "access": "w", | ||
25 | - "size": 1 | ||
26 | - }, | ||
27 | - "$mcmProtocolLevel": { | ||
28 | - "id": -2, | ||
29 | - "align": 2, | ||
30 | - "attributes": {"readonly": true}, | ||
31 | - "type": "u2", | ||
32 | - "access": "r", | ||
33 | - "size": 2 | ||
34 | - }, | ||
35 | - "count": { | ||
36 | - "id": 2, | ||
37 | - "align": 2, | ||
38 | - "attributes": {"readwrite": true}, | ||
39 | - "type": "i2", | ||
40 | - "access": "rw", | ||
41 | - "size": 2 | ||
42 | - }, | ||
43 | - "$mobileRssi": { | ||
44 | - "id": -8, | ||
45 | - "align": 1, | ||
46 | - "attributes": {"readonly": true}, | ||
47 | - "type": "i1", | ||
48 | - "access": "r", | ||
49 | - "size": 1 | ||
50 | - }, | ||
51 | - "$mcmDisconnect": { | ||
52 | - "id": -9, | ||
53 | - "align": 1, | ||
54 | - "attributes": {"writeonly": true}, | ||
55 | - "type": "u1", | ||
56 | - "access": "w", | ||
57 | - "size": 1 | ||
58 | - }, | ||
59 | - "delay": { | ||
60 | - "id": 3, | ||
61 | - "align": 2, | ||
62 | - "attributes": {"readwrite": true}, | ||
63 | - "type": "N:0.500000,2.000000,0.100000,3/u2", | ||
64 | - "access": "rw", | ||
65 | - "size": 2 | ||
66 | - }, | ||
67 | - "$eapBuildDate": { | ||
68 | - "id": -4, | ||
69 | - "align": 1, | ||
70 | - "attributes": {"readonly": true}, | ||
71 | - "type": "A8:u1", | ||
72 | - "access": "r", | ||
73 | - "size": 8 | ||
74 | - }, | ||
75 | - "$resourceCount": { | ||
76 | - "id": -7, | ||
77 | - "align": 1, | ||
78 | - "attributes": {"readonly": true}, | ||
79 | - "type": "S:system@emmoco.com.System/ResourceCount", | ||
80 | - "access": "r", | ||
81 | - "size": 2 | ||
82 | - }, | ||
83 | - "ledState": { | ||
84 | - "id": 4, | ||
85 | - "align": 1, | ||
86 | - "attributes": { | ||
87 | - "indicator": true, | ||
88 | - "readonly": true | ||
89 | - }, | ||
90 | - "type": "E:@emmoco.com.Blinker/LedState", | ||
91 | - "access": "ir", | ||
92 | - "size": 1 | ||
93 | - }, | ||
94 | - "$fileIndexReset": { | ||
95 | - "id": -5, | ||
96 | - "align": 2, | ||
97 | - "attributes": {"writeonly": true}, | ||
98 | - "type": "i2", | ||
99 | - "access": "w", | ||
100 | - "size": 2 | ||
101 | - } | ||
102 | - }, | ||
103 | - "resourceNamesSys": [ | ||
104 | - "$eapBuildDate", | ||
105 | - "$eapProtocolLevel", | ||
106 | - "$fileIndexReset", | ||
107 | - "$mcmDisconnect", | ||
108 | - "$mcmProtocolLevel", | ||
109 | - "$mobileRssi", | ||
110 | - "$resourceCount", | ||
111 | - "$schemaHash" | ||
112 | - ], | ||
113 | - "manifest": { | ||
114 | - "protocolLevel": 12, | ||
115 | - "hash": [ | ||
116 | - 194, | ||
117 | - 8, | ||
118 | - 191, | ||
119 | - 173, | ||
120 | - 237, | ||
121 | - 198, | ||
122 | - 193, | ||
123 | - 165, | ||
124 | - 88, | ||
125 | - 202, | ||
126 | - 74, | ||
127 | - 246, | ||
128 | - 70, | ||
129 | - 59, | ||
130 | - 102, | ||
131 | - 128 | ||
132 | - ], | ||
133 | - "toolVersion": "12.0.0.201211010336", | ||
134 | - "name": "Blinker", | ||
135 | - "$$md5": "73d98dc6eb4c17eea377d5969c0e49d2", | ||
136 | - "build": [ | ||
137 | - 70, | ||
138 | - 123, | ||
139 | - 11, | ||
140 | - 227, | ||
141 | - 69, | ||
142 | - 1, | ||
143 | - 0, | ||
144 | - 0 | ||
145 | - ], | ||
146 | - "date": "2014-05-10T00:12:31T", | ||
147 | - "maxAlign": 2, | ||
148 | - "maxSize": 20, | ||
149 | - "version": "1.0.0" | ||
150 | - }, | ||
151 | - "resourceNames": [ | ||
152 | - "cmd", | ||
153 | - "count", | ||
154 | - "delay", | ||
155 | - "ledState", | ||
156 | - "$mcmProtocolLevel", | ||
157 | - "$eapProtocolLevel", | ||
158 | - "$eapBuildDate", | ||
159 | - "$fileIndexReset", | ||
160 | - "$schemaHash", | ||
161 | - "$resourceCount", | ||
162 | - "$mobileRssi", | ||
163 | - "$mcmDisconnect" | ||
164 | - ], | ||
165 | - "attributes": { | ||
166 | - "description": "Blinker, the hello world program for mobile control", | ||
167 | - "version": "1.0.0" | ||
168 | - }, | ||
169 | - "types": { | ||
170 | - "@emmoco.com.Blinker/LedState": { | ||
171 | - "values": [ | ||
172 | - "LED_OFF", | ||
173 | - "LED_ON" | ||
174 | - ], | ||
175 | - "align": 1, | ||
176 | - "type": "E:@emmoco.com.Blinker/LedState", | ||
177 | - "size": 1 | ||
178 | - }, | ||
179 | - "system@emmoco.com.System/ResourceCount": { | ||
180 | - "align": 1, | ||
181 | - "type": "S:system@emmoco.com.System/ResourceCount", | ||
182 | - "size": 2, | ||
183 | - "fields": [ | ||
184 | - { | ||
185 | - "pad": 0, | ||
186 | - "align": 1, | ||
187 | - "name": "app", | ||
188 | - "type": "u1", | ||
189 | - "size": 1 | ||
190 | - }, | ||
191 | - { | ||
192 | - "pad": 0, | ||
193 | - "align": 1, | ||
194 | - "name": "sys", | ||
195 | - "type": "u1", | ||
196 | - "size": 1 | ||
197 | - } | ||
198 | - ] | ||
199 | - }, | ||
200 | - "std:i2": { | ||
201 | - "align": 2, | ||
202 | - "size": 2 | ||
203 | - }, | ||
204 | - "std:i1": { | ||
205 | - "align": 1, | ||
206 | - "size": 1 | ||
207 | - }, | ||
208 | - "std:u1": { | ||
209 | - "align": 1, | ||
210 | - "size": 1 | ||
211 | - }, | ||
212 | - "@emmoco.com.Blinker/Cmd": { | ||
213 | - "values": [ | ||
214 | - "START_CMD", | ||
215 | - "STOP_CMD" | ||
216 | - ], | ||
217 | - "align": 1, | ||
218 | - "type": "E:@emmoco.com.Blinker/Cmd", | ||
219 | - "size": 1 | ||
220 | - }, | ||
221 | - "std:u2": { | ||
222 | - "align": 2, | ||
223 | - "size": 2 | ||
224 | - } | ||
225 | - }, | ||
226 | - "resourceNamesApp": [ | ||
227 | - "cmd", | ||
228 | - "count", | ||
229 | - "delay", | ||
230 | - "ledState" | ||
231 | - ], | ||
232 | - "imports": {"@emmoco.com.Blinker": true} | ||
233 | -} | ||
234 | \ No newline at end of file | 0 | \ No newline at end of file |
BlinkerSchema/schema.ems deleted
1 | -version = "1.0.0" | ||
2 | -description = "Blinker, the hello world program for mobile control" | ||
3 | - | ||
4 | -schema Blinker { | ||
5 | - | ||
6 | - /* -------- resource cmd -------- */ | ||
7 | - enum Cmd { | ||
8 | - START_CMD, STOP_CMD | ||
9 | - } | ||
10 | - Cmd cmd { | ||
11 | - writeonly | ||
12 | - } | ||
13 | - | ||
14 | - /* -------- resource count -------- */ | ||
15 | - int16 count { | ||
16 | - readwrite | ||
17 | - } | ||
18 | - | ||
19 | - /* -------- resource delay -------- */ | ||
20 | - num <0.5, 2.0, 0.100> delay { | ||
21 | - readwrite | ||
22 | - } | ||
23 | - | ||
24 | - /* -------- resource ledState -------- */ | ||
25 | - enum LedState { | ||
26 | - LED_OFF, LED_ON | ||
27 | - } | ||
28 | - LedState ledState { | ||
29 | - readonly | ||
30 | - indicator | ||
31 | - } | ||
32 | -} |
CommonLaunchPad/.externalToolConfigurations/LaunchPad Application.launch deleted
1 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | -<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> | ||
3 | -<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/> | ||
4 | -<mapAttribute key="org.eclipse.debug.core.environmentVariables"> | ||
5 | -<mapEntry key="PATH" value="${eclipse_home}/msptools/bin${system_property:path.separator}${env_var:PATH}"/> | ||
6 | -</mapAttribute> | ||
7 | -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> | ||
8 | -<listEntry value="org.eclipse.ui.externaltools.launchGroup"/> | ||
9 | -</listAttribute> | ||
10 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${project}"/> | ||
11 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${eclipse_home}/emmoco/msptools/bin/gmake${exe_ext}"/> | ||
12 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="load COMMON=${project_loc:/CommonLaunchPad}"/> | ||
13 | -<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/> | ||
14 | -</launchConfiguration> |
CommonLaunchPad/rules.mk deleted
1 | -MCU = msp430g2553 | ||
2 | - | ||
3 | -CC = msp430-gcc | ||
4 | -OBJCOPY = msp430-objcopy | ||
5 | -SIZE = msp430-size | ||
6 | -MSPDEBUG = mspdebug | ||
7 | -MSP430FLASHER = MSP430Flasher | ||
8 | -EMBUILDER = #em-builder | ||
9 | -COPTS = -Os -Wall -fno-strict-aliasing -c -g -mmcu=$(MCU) | ||
10 | -LDOPTS = -mmcu=$(MCU) -Wl,-Map=main.map | ||
11 | - | ||
12 | -EMSOUT = $(SCHEMA)/out | ||
13 | -RMFILES = *.out *.map *.hex *.obj | ||
14 | -CFLAGS = -I$(COMMON) -I$(EMSOUT) $(COPTS) | ||
15 | -LDFLAGS = $(LDOPTS) | ||
16 | -VPATH = $(COMMON) | ||
17 | -OUTFILE = main.out | ||
18 | - | ||
19 | -all: $(OUTFILE) | ||
20 | - | ||
21 | -ifeq (,$(findstring Windows,$(OS))) | ||
22 | -load: out-check | ||
23 | - $(MSPDEBUG) rf2500 "prog $(OUTFILE)" 2>&1 | ||
24 | -else | ||
25 | -load: $(OUTFILE:.out=.hex) | ||
26 | - $(MSP430FLASHER) -i USB -m AUTO -e ERASE_MAIN -n $(MCU) -w $< -v -z [VCC] -g | ||
27 | -endif | ||
28 | - | ||
29 | -$(OUTFILE): $(OBJECTS) | ||
30 | - $(CC) $(LDFLAGS) -o $@ $^ | ||
31 | - $(SIZE) $@ | ||
32 | - | ||
33 | -%.hex: out-check | ||
34 | - $(OBJCOPY) -O ihex $(@:.hex=.out) $@ | ||
35 | - | ||
36 | -%.obj: %.c $(EMSOUT)/$(EMSNAME).h | ||
37 | - $(CC) $(CFLAGS) -o $@ $< | ||
38 | - | ||
39 | -$(EMSNAME).obj: $(EMSOUT)/$(EMSNAME).c $(EMSOUT)/$(EMSNAME).h | ||
40 | - $(CC) $(CFLAGS) -o $@ $< | ||
41 | - | ||
42 | -$(EMSOUT)/$(EMSNAME).h: $(SCHEMA)/schema.ems | ||
43 | - $(EMBUILDER) -v --root=$(<D) $< | ||
44 | - | ||
45 | -local-clean: | ||
46 | -ifeq (,$(findstring Windows,$(OS))) | ||
47 | - rm -f $(RMFILES) | ||
48 | -else | ||
49 | -ifneq (,$(wildcard $(RMFILES))) | ||
50 | - cmd /c del /q $(wildcard $(RMFILES)) | ||
51 | -endif | ||
52 | -endif | ||
53 | - | ||
54 | -clean: local-clean | ||
55 | -ifeq (,$(findstring Windows,$(OS))) | ||
56 | - rm -rf $(EMSOUT) | ||
57 | -else | ||
58 | -ifneq (,$(wildcard $(EMSOUT))) | ||
59 | - cmd /c rmdir /q /s $(subst /,\,$(EMSOUT)) | ||
60 | -endif | ||
61 | -endif | ||
62 | - | ||
63 | -out-check: | ||
64 | -ifeq (,$(wildcard $(OUTFILE))) | ||
65 | - @echo error: $(OUTFILE): No such file or directory 1>&2 | ||
66 | - @exit 1 | ||
67 | -endif | ||
68 | - | ||
69 | -.PHONY: all load clean local-clean out-check |
DUREX Vendor Control/CommunicationProtocol.m
@@ -129,7 +129,7 @@ | @@ -129,7 +129,7 @@ | ||
129 | numBytes = remainingBytes; | 129 | numBytes = remainingBytes; |
130 | remainingBytes = 0; | 130 | remainingBytes = 0; |
131 | } | 131 | } |
132 | - [[EMConnectionManager sharedManager] writeValue:[NSNumber numberWithUnsignedChar:(unsigned char)numBytes] toResource:@"data" onSuccess:^ | 132 | + [[EMConnectionManager sharedManager] writeValue:[NSNumber numberWithUnsignedChar:(unsigned char)numBytes] toResource:@"numBytes" onSuccess:^ |
133 | { | 133 | { |
134 | status = TRUE; | 134 | status = TRUE; |
135 | } | 135 | } |
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | symbolName = "+[CommunicationProtocol sharedProtocol]" | 25 | symbolName = "+[CommunicationProtocol sharedProtocol]" |
26 | moduleName = "DUREX Vendor Control" | 26 | moduleName = "DUREX Vendor Control" |
27 | urlString = "file://localhost/Users/imanol/devel/durex/DUREX%20Vendor%20Control/CommunicationProtocol.m" | 27 | urlString = "file://localhost/Users/imanol/devel/durex/DUREX%20Vendor%20Control/CommunicationProtocol.m" |
28 | - timestampString = "426429770.784755" | 28 | + timestampString = "428340358.431629" |
29 | startingColumnNumber = "9223372036854775807" | 29 | startingColumnNumber = "9223372036854775807" |
30 | endingColumnNumber = "9223372036854775807" | 30 | endingColumnNumber = "9223372036854775807" |
31 | startingLineNumber = "20" | 31 | startingLineNumber = "20" |
@@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
39 | symbolName = "__39+[CommunicationProtocol sharedProtocol]_block_invoke" | 39 | symbolName = "__39+[CommunicationProtocol sharedProtocol]_block_invoke" |
40 | moduleName = "DUREX Vendor Control" | 40 | moduleName = "DUREX Vendor Control" |
41 | urlString = "file://localhost/Users/imanol/devel/durex/DUREX%20Vendor%20Control/CommunicationProtocol.m" | 41 | urlString = "file://localhost/Users/imanol/devel/durex/DUREX%20Vendor%20Control/CommunicationProtocol.m" |
42 | - timestampString = "426429770.78569" | 42 | + timestampString = "428340358.432031" |
43 | startingColumnNumber = "9223372036854775807" | 43 | startingColumnNumber = "9223372036854775807" |
44 | endingColumnNumber = "9223372036854775807" | 44 | endingColumnNumber = "9223372036854775807" |
45 | startingLineNumber = "20" | 45 | startingLineNumber = "20" |
DUREX/.project deleted
1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
2 | -<projectDescription> | ||
3 | - <name>DUREX</name> | ||
4 | - <comment></comment> | ||
5 | - <projects> | ||
6 | - </projects> | ||
7 | - <buildSpec> | ||
8 | - <buildCommand> | ||
9 | - <name>com.emmoco.mcmtooling.core.mcmToolingBuilder</name> | ||
10 | - <arguments> | ||
11 | - </arguments> | ||
12 | - </buildCommand> | ||
13 | - </buildSpec> | ||
14 | - <natures> | ||
15 | - <nature>com.emmoco.mcmtooling.core.mcmToolingNature</nature> | ||
16 | - </natures> | ||
17 | -</projectDescription> |
DUREX/Em/DUREX-STUBS.c deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T16:44:10T ****/ | ||
2 | -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ | ||
3 | - | ||
4 | -#include "DUREX.h" | ||
5 | - | ||
6 | -#ifdef DUREX_STUBS_ /* enables optional inclusion of application stubs */ | ||
7 | - | ||
8 | -/* Copy the function skeletons below into your own application source file */ | ||
9 | - | ||
10 | -void DUREX_connectHandler(void) { | ||
11 | - /* TODO: application is now connected */ | ||
12 | -} | ||
13 | - | ||
14 | -void DUREX_disconnectHandler(void) { | ||
15 | - /* TODO: application is now disconnected */ | ||
16 | -} | ||
17 | - | ||
18 | -void DUREX_numBytes_fetch(DUREX_numBytes_t* output) { | ||
19 | - /* TODO: read resource 'numBytes' into 'output' */ | ||
20 | -} | ||
21 | - | ||
22 | -void DUREX_numBytes_store(DUREX_numBytes_t* input) { | ||
23 | - /* TODO: write resource 'numBytes' from 'input' */ | ||
24 | -} | ||
25 | - | ||
26 | -void DUREX_data_fetch(DUREX_data_t output) { | ||
27 | - /* TODO: read resource 'data' into 'output' */ | ||
28 | -} | ||
29 | - | ||
30 | -void DUREX_data_store(DUREX_data_t input) { | ||
31 | - /* TODO: write resource 'data' from 'input' */ | ||
32 | -} | ||
33 | - | ||
34 | -void DUREX_numPackets_fetch(DUREX_numPackets_t* output) { | ||
35 | - /* TODO: read resource 'numPackets' into 'output' */ | ||
36 | -} | ||
37 | - | ||
38 | -void DUREX_numPackets_store(DUREX_numPackets_t* input) { | ||
39 | - /* TODO: write resource 'numPackets' from 'input' */ | ||
40 | -} | ||
41 | - | ||
42 | -void DUREX_messageAvailable_fetch(DUREX_messageAvailable_t* output) { | ||
43 | - /* TODO: read resource 'messageAvailable' into 'output' */ | ||
44 | -} | ||
45 | - | ||
46 | -#endif /* application stubs */ |
DUREX/Em/DUREX.c deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T16:44:10T ****/ | ||
2 | -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ | ||
3 | - | ||
4 | -#include "Em_Message.h" | ||
5 | -#include "DUREX.h" | ||
6 | - | ||
7 | -#ifdef __cplusplus | ||
8 | -extern "C" { | ||
9 | -#endif | ||
10 | - | ||
11 | -#define Em_Message_protocolLevel 13 | ||
12 | - | ||
13 | -typedef struct Em_App_Message { | ||
14 | - uint8_t dummy[3]; | ||
15 | - uint8_t sot; | ||
16 | - Em_Message_Header hdr; | ||
17 | - uint8_t data[229]; | ||
18 | -} Em_App_Message; | ||
19 | - | ||
20 | -const uint8_t Em_App_hash[] = {28, 106, 83, 11, 248, 159, 192, 243, 66, 193, 233, 148, 55, 208, 191, 77, 13, 0, ((sizeof(struct{uint8_t f1; uint16_t f2;}) - sizeof(uint16_t)) << 4) | (sizeof(struct{uint8_t f1; uint32_t f2;}) - sizeof(uint32_t))}; | ||
21 | - | ||
22 | -const uint8_t Em_App_build[] = {208, 202, 48, 251, 69, 1, 0, 0}; | ||
23 | - | ||
24 | -#define Em_App_APP_RESOURCE_COUNT 4 | ||
25 | -#define Em_App_SYS_RESOURCE_COUNT 9 | ||
26 | - | ||
27 | -#define Em_App_ACCEPT DUREX_accept | ||
28 | -#define Em_App_ACTIVATEPARAMETERS DUREX_activateParameters | ||
29 | -#define Em_App_BROADCASTOFF DUREX_broadcastOff | ||
30 | -#define Em_App_DISCONNECT DUREX_disconnect | ||
31 | -#define Em_App_PAIRINGON DUREX_pairingOn | ||
32 | -#define Em_App_PAIRINGOFF DUREX_pairingOff | ||
33 | -#define Em_App_RESET DUREX_reset | ||
34 | -#define Em_App_SETDEVICENAME DUREX_setDeviceName | ||
35 | -#define Em_App_START DUREX_start | ||
36 | - | ||
37 | -#define Em_App_CONNECTHANDLER DUREX_connectHandler | ||
38 | -#define Em_App_DISCONNECTHANDLER DUREX_disconnectHandler | ||
39 | - | ||
40 | -#define Em_App_MAX_INDICATOR 2 | ||
41 | - | ||
42 | -/* BEGIN common code */ | ||
43 | - | ||
44 | -enum {Em_App_IDLE, Em_App_STARTING, Em_App_DISCONNECTED, Em_App_CONNECTED}; | ||
45 | - | ||
46 | -typedef struct Em_App_Indicator { | ||
47 | - uint8_t dummy[3]; | ||
48 | - uint8_t sot; | ||
49 | - Em_Message_Header hdr; | ||
50 | - uint8_t data[Em_Message_INDSIZE]; | ||
51 | -} Em_App_Indicator; | ||
52 | - | ||
53 | -union { uint32_t align; Em_App_Message msg; } Em_App_msg_u; | ||
54 | -union { uint32_t align; Em_App_Indicator ind; } Em_App_ind_u; | ||
55 | -#define Em_App_msg Em_App_msg_u.msg | ||
56 | -#define Em_App_ind Em_App_ind_u.ind | ||
57 | - | ||
58 | -void (*Em_App_pdHdlr)(void); | ||
59 | - | ||
60 | -const uint16_t Em_App_endian = 0x0100; | ||
61 | - | ||
62 | -Em_Message_Size Em_App_recvIdx; | ||
63 | -Em_Message_Size Em_App_recvSize; | ||
64 | -Em_Message_Size Em_App_xmitIdx; | ||
65 | -Em_Message_Size Em_App_xmitSize; | ||
66 | - | ||
67 | -uint8_t Em_App_state = Em_App_IDLE; | ||
68 | -int32_t Em_App_fileIndex = 0; | ||
69 | -uint32_t Em_App_xmitMask = 0; | ||
70 | - | ||
71 | -uint8_t* Em_App_valp; | ||
72 | -uint8_t* Em_App_bufp; | ||
73 | -const char* Em_App_desc; | ||
74 | - | ||
75 | -uint8_t* Em_App_inBuf = (uint8_t*)&Em_App_msg.hdr; | ||
76 | -uint8_t* Em_App_outBuf = 0; | ||
77 | - | ||
78 | -uint8_t* _Em_Message_rxBuf = 0; | ||
79 | -uint8_t _Em_Message_rxCnt = 0; | ||
80 | - | ||
81 | -uint8_t* _Em_Message_txBuf = 0; | ||
82 | -uint8_t _Em_Message_txCnt = 0; | ||
83 | - | ||
84 | -#define Em_App_DEVNAME_LEN 9 | ||
85 | -const char* Em_App_devName = 0; | ||
86 | - | ||
87 | -void Em_App_fetchDispatch(void); | ||
88 | -void Em_Message_marshallToBuf(uint8_t* valp, uint8_t* bufp, const char* desc); | ||
89 | -void Em_Message_marshallToVal(uint8_t* valp, uint8_t* bufp, const char* desc); | ||
90 | -void Em_App_storeDispatch(void); | ||
91 | -void Em_App_sendIndicator(Em_Message_ResId indId); | ||
92 | -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size); | ||
93 | -void Em_App_startIndSend(void); | ||
94 | -void Em_App_startResSend(void); | ||
95 | -void Em_App_sysFetchDispatch(void); | ||
96 | -void Em_App_sysStoreDispatch(void); | ||
97 | -bool Em_App_xmitReady(Em_Message_ResId indId); | ||
98 | - | ||
99 | -void Em_Message_nextXmit(void) { | ||
100 | - uint8_t key = Em_Hal_lock(); | ||
101 | - if (Em_App_xmitMask != 0) { | ||
102 | - uint8_t i; | ||
103 | - uint32_t m; | ||
104 | - for (i = 0, m = 0x1; i < Em_App_MAX_INDICATOR; i++, m <<= 1) { | ||
105 | - if (Em_App_xmitMask & m) { | ||
106 | - Em_App_xmitMask &= ~m; | ||
107 | - if (i == 0) { | ||
108 | - Em_App_startResSend(); | ||
109 | - } | ||
110 | - else { | ||
111 | - Em_App_sendIndicator(i - 1); | ||
112 | - } | ||
113 | - break; | ||
114 | - } | ||
115 | - } | ||
116 | - } | ||
117 | - Em_Hal_unlock(key); | ||
118 | -} | ||
119 | - | ||
120 | -void Em_Message_restart(void) { | ||
121 | - Em_App_START(); | ||
122 | -} | ||
123 | - | ||
124 | -void Em_App_ACCEPT(bool enable) { | ||
125 | - if (Em_App_state == Em_App_CONNECTED) { | ||
126 | - return; | ||
127 | - } | ||
128 | - Em_App_ind.sot = 0; | ||
129 | - Em_App_ind.hdr.kind = Em_Message_ACCEPT; | ||
130 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
131 | - Em_App_ind.hdr.resId = enable; | ||
132 | - Em_App_startIndSend(); | ||
133 | -} | ||
134 | - | ||
135 | -void Em_App_ACTIVATEPARAMETERS(uint8_t group) { | ||
136 | - if (Em_App_state == Em_App_IDLE || Em_App_state == Em_App_STARTING) { | ||
137 | - return; | ||
138 | - } | ||
139 | - Em_App_ind.sot = 0; | ||
140 | - Em_App_ind.hdr.kind = Em_Message_ACTIVE_PARAMS; | ||
141 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
142 | - Em_App_ind.hdr.resId = group; | ||
143 | - Em_App_startIndSend(); | ||
144 | -} | ||
145 | - | ||
146 | -void Em_App_BROADCASTOFF(void) { | ||
147 | - Em_App_ind.sot = 0; | ||
148 | - Em_App_ind.hdr.kind = Em_Message_INDICATOR; | ||
149 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
150 | - Em_App_ind.hdr.resId = 0; | ||
151 | - Em_App_startIndSend(); | ||
152 | -} | ||
153 | - | ||
154 | -void Em_App_DISCONNECT(void) { | ||
155 | - if (Em_App_state != Em_App_CONNECTED) { | ||
156 | - return; | ||
157 | - } | ||
158 | - Em_App_state = Em_App_DISCONNECTED; | ||
159 | - Em_App_ind.sot = 0; | ||
160 | - Em_App_ind.hdr.kind = Em_Message_DISCONNECT; | ||
161 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
162 | - Em_App_ind.hdr.resId = 0; | ||
163 | - Em_App_startIndSend(); | ||
164 | -} | ||
165 | - | ||
166 | -void Em_Message_dispatch(void) { | ||
167 | - if (Em_App_state == Em_App_IDLE) { | ||
168 | - return; | ||
169 | - } | ||
170 | - switch (Em_App_msg.hdr.kind) { | ||
171 | - case Em_Message_CONNECT: | ||
172 | - Em_App_state = Em_App_CONNECTED; | ||
173 | - Em_App_CONNECTHANDLER(); | ||
174 | - break; | ||
175 | - case Em_Message_DISCONNECT: | ||
176 | - Em_App_state = Em_App_DISCONNECTED; | ||
177 | - Em_App_DISCONNECTHANDLER(); | ||
178 | - break; | ||
179 | - case Em_Message_PAIRING_DONE: | ||
180 | - if (Em_App_pdHdlr) { | ||
181 | - (*Em_App_pdHdlr)(); | ||
182 | - } | ||
183 | - break; | ||
184 | - case Em_Message_FETCH: | ||
185 | - if (Em_App_msg.hdr.resId < 0x80) { | ||
186 | - Em_App_fetchDispatch(); | ||
187 | - } | ||
188 | - else { | ||
189 | - Em_App_sysFetchDispatch(); | ||
190 | - } | ||
191 | - break; | ||
192 | - case Em_Message_STORE: | ||
193 | - if (Em_App_msg.hdr.resId < 0x80) { | ||
194 | - Em_App_storeDispatch(); | ||
195 | - } | ||
196 | - else { | ||
197 | - Em_App_sysStoreDispatch(); | ||
198 | - } | ||
199 | - break; | ||
200 | - } | ||
201 | -} | ||
202 | - | ||
203 | -void Em_App_marshallToBuf() { | ||
204 | - char ch; | ||
205 | - while ((ch = *Em_App_desc++)) { | ||
206 | - switch (ch) { | ||
207 | - case '0' : { | ||
208 | - *Em_App_bufp++ = 0; | ||
209 | - break; | ||
210 | - } | ||
211 | - case '1' : { | ||
212 | - *Em_App_bufp++ = *Em_App_valp & 0xFF; | ||
213 | - break; | ||
214 | - } | ||
215 | - case '2' : { | ||
216 | - uint16_t v16 = *(uint16_t*)Em_App_valp; | ||
217 | - *Em_App_bufp++ = v16 & 0xFF; | ||
218 | - *Em_App_bufp++ = (v16 >> 8) & 0xFF; | ||
219 | - break; | ||
220 | - } | ||
221 | - case '4' : { | ||
222 | - if (((uint32_t)Em_App_valp & 0x1)) Em_App_valp++; | ||
223 | - uint32_t v32 = *(uint32_t*)Em_App_valp++; | ||
224 | - *Em_App_bufp++ = v32 & 0xFF; | ||
225 | - *Em_App_bufp++ = (v32 >> 8) & 0xFF; | ||
226 | - *Em_App_bufp++ = (v32 >> 16) & 0xFF; | ||
227 | - *Em_App_bufp++ = (v32 >> 24) & 0xFF; | ||
228 | - break; | ||
229 | - } | ||
230 | - } | ||
231 | - Em_App_valp += 1; | ||
232 | - } | ||
233 | -} | ||
234 | - | ||
235 | -void Em_App_marshallToVal() { | ||
236 | - char ch; | ||
237 | - while ((ch = *Em_App_desc++)) { | ||
238 | - switch (ch) { | ||
239 | - case '0' : { | ||
240 | - *Em_App_valp = 0; | ||
241 | - Em_App_bufp += 1; | ||
242 | - break; | ||
243 | - } | ||
244 | - case '1' : { | ||
245 | - *Em_App_valp = *Em_App_bufp++ & 0xFF; | ||
246 | - break; | ||
247 | - } | ||
248 | - case '2' : { | ||
249 | - uint16_t v16 = *Em_App_bufp++ & 0xFF; | ||
250 | - v16 |= (*Em_App_bufp++ << 8); | ||
251 | - *(uint16_t*)Em_App_valp = v16; | ||
252 | - break; | ||
253 | - } | ||
254 | - case '4' : { | ||
255 | - if (((uint32_t)Em_App_valp & 0x1)) Em_App_valp++; | ||
256 | - uint32_t v32 = (uint32_t)*Em_App_bufp++ & 0xFF; | ||
257 | - v32 |= ((uint32_t)*Em_App_bufp++ << 8); | ||
258 | - v32 |= ((uint32_t)*Em_App_bufp++ << 16); | ||
259 | - v32 |= ((uint32_t)*Em_App_bufp++ << 24); | ||
260 | - *(uint32_t*)Em_App_valp++ = v32; | ||
261 | - break; | ||
262 | - } | ||
263 | - } | ||
264 | - Em_App_valp += 1; | ||
265 | - } | ||
266 | -} | ||
267 | - | ||
268 | -void Em_App_PAIRINGOFF(void(*handler)(void)) { | ||
269 | - Em_App_PAIRINGON(0, handler); | ||
270 | -} | ||
271 | - | ||
272 | -void Em_App_PAIRINGON(uint8_t secs, void(*handler)(void)) { | ||
273 | - if (Em_App_state != Em_App_DISCONNECTED) { | ||
274 | - return; | ||
275 | - } | ||
276 | - Em_App_pdHdlr = handler; | ||
277 | - Em_App_ind.sot = 0; | ||
278 | - Em_App_ind.hdr.kind = Em_Message_PAIRING; | ||
279 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
280 | - Em_App_ind.hdr.resId = secs; | ||
281 | - Em_App_startIndSend(); | ||
282 | -} | ||
283 | - | ||
284 | -void Em_App_RESET(void) { | ||
285 | - Em_Hal_reset(); | ||
286 | - _Em_Message_rxBuf = _Em_Message_txBuf = 0; | ||
287 | - _Em_Message_rxCnt = _Em_Message_txCnt = 0; | ||
288 | - Em_App_recvIdx = Em_App_recvSize = Em_App_xmitIdx = Em_App_xmitSize = 0; | ||
289 | - Em_App_state = Em_App_IDLE; | ||
290 | - Em_App_fileIndex = 0; | ||
291 | - Em_App_xmitMask = 0; | ||
292 | -} | ||
293 | - | ||
294 | -void Em_App_SETDEVICENAME(const char* name) { | ||
295 | - Em_App_devName = name; | ||
296 | -} | ||
297 | - | ||
298 | -void Em_App_START(void) { | ||
299 | - Em_App_RESET(); | ||
300 | - Em_App_state = Em_App_STARTING; | ||
301 | -} | ||
302 | - | ||
303 | -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size) { | ||
304 | - if (Em_App_state != Em_App_IDLE) { | ||
305 | - Em_App_msg.sot = 0; | ||
306 | - Em_App_msg.hdr.kind = kind; | ||
307 | - Em_App_msg.hdr.size = size + sizeof (Em_Message_Header); | ||
308 | - if (Em_App_xmitReady(0)) { | ||
309 | - Em_App_startResSend(); | ||
310 | - } | ||
311 | - } | ||
312 | -} | ||
313 | - | ||
314 | -void Em_App_startIndSend(void) { | ||
315 | - Em_App_outBuf = (uint8_t*)&Em_App_ind.sot; | ||
316 | - Em_App_xmitSize = Em_App_ind.hdr.size + 1; | ||
317 | - Em_App_xmitIdx = 0; | ||
318 | - Em_Hal_startSend(); | ||
319 | -} | ||
320 | - | ||
321 | -void Em_App_startResSend(void) { | ||
322 | - Em_App_outBuf = (uint8_t*)&Em_App_msg.sot; | ||
323 | - Em_App_xmitSize = Em_App_msg.hdr.size + 1; | ||
324 | - Em_App_xmitIdx = 0; | ||
325 | - Em_Hal_startSend(); | ||
326 | -} | ||
327 | - | ||
328 | -void Em_App_sysFetchDispatch(void) { | ||
329 | - uint8_t size = 0; | ||
330 | - int i, j; | ||
331 | - switch (Em_App_msg.hdr.resId) { | ||
332 | - case Em_Message_SYS_SCHEMA_HASH: | ||
333 | - for (i = 0; i < sizeof (Em_App_hash); i++) { | ||
334 | - Em_App_msg.data[i] = Em_App_hash[i]; | ||
335 | - } | ||
336 | - Em_App_msg.data[sizeof (Em_App_hash)] = *((uint8_t*)&Em_App_endian); | ||
337 | - size = sizeof (Em_App_hash) + 1; | ||
338 | - break; | ||
339 | - case Em_Message_SYS_MCM_NAME: | ||
340 | - if (Em_App_devName) { | ||
341 | - for (i = 0; i < Em_App_DEVNAME_LEN; i++) { | ||
342 | - if ((Em_App_msg.data[i] = Em_App_devName[i]) == 0) { | ||
343 | - break; | ||
344 | - } | ||
345 | - } | ||
346 | - for (j = i; j < Em_App_DEVNAME_LEN; j++) { | ||
347 | - Em_App_msg.data[j] = 0; | ||
348 | - } | ||
349 | - size = Em_App_DEVNAME_LEN; | ||
350 | - } | ||
351 | - break; | ||
352 | - case Em_Message_SYS_EAP_PROTOCOL_LEVEL: | ||
353 | - *((Em_Message_protocolLevel_t*)Em_App_msg.data) = Em_Message_protocolLevel; | ||
354 | - size = sizeof (Em_Message_protocolLevel_t); | ||
355 | - break; | ||
356 | - case Em_Message_SYS_EAP_BUILD_DATE: | ||
357 | - for (i = 0; i < sizeof (Em_App_build); i++) { | ||
358 | - Em_App_msg.data[i] = Em_App_build[i]; | ||
359 | - } | ||
360 | - size = sizeof (Em_App_build); | ||
361 | - break; | ||
362 | - case Em_Message_SYS_RESOURCE_COUNT: | ||
363 | - Em_App_msg.data[0] = Em_App_APP_RESOURCE_COUNT; | ||
364 | - Em_App_msg.data[1] = Em_App_SYS_RESOURCE_COUNT; | ||
365 | - size = 2; | ||
366 | - break; | ||
367 | - } | ||
368 | - Em_App_sendResponse(Em_Message_FETCH_DONE, size); | ||
369 | -} | ||
370 | - | ||
371 | -void Em_App_sysStoreDispatch(void) { | ||
372 | - switch (Em_App_msg.hdr.resId) { | ||
373 | - case Em_Message_SYS_FILE_INDEX_RESET: | ||
374 | - Em_App_fileIndex = 0; | ||
375 | - break; | ||
376 | - } | ||
377 | - Em_App_sendResponse(Em_Message_STORE_DONE, 0); | ||
378 | -} | ||
379 | - | ||
380 | -bool Em_App_xmitReady(Em_Message_ResId indId) { | ||
381 | - uint8_t key = Em_Hal_lock(); | ||
382 | - bool res = _Em_Message_txBuf == 0 && Em_App_xmitMask == 0; | ||
383 | - if (!res) { | ||
384 | - Em_App_xmitMask |= (1 << indId); | ||
385 | - } | ||
386 | - Em_Hal_unlock(key); | ||
387 | - return res; | ||
388 | -} | ||
389 | - | ||
390 | -/* END common code */ | ||
391 | - | ||
392 | -void Em_App_fetchDispatch(void) { | ||
393 | - uint8_t size = 0; | ||
394 | - switch (Em_App_msg.hdr.resId) { | ||
395 | - case 0: { | ||
396 | - break; | ||
397 | - } | ||
398 | - case 1: { | ||
399 | -#ifdef Em_16BIT | ||
400 | - DUREX_numBytes_t val; | ||
401 | - Em_App_valp = (uint8_t*)&val; | ||
402 | - Em_App_bufp = Em_App_msg.data; | ||
403 | - Em_App_desc = "1"; | ||
404 | - DUREX_numBytes_fetch(&val); | ||
405 | - Em_App_marshallToBuf(); | ||
406 | -#else | ||
407 | - DUREX_numBytes_fetch((void*)Em_App_msg.data); | ||
408 | -#endif | ||
409 | - size = 1; | ||
410 | - break; | ||
411 | - } | ||
412 | - case 2: { | ||
413 | -#ifdef Em_16BIT | ||
414 | - DUREX_data_t val; | ||
415 | - Em_App_valp = (uint8_t*)&val; | ||
416 | - Em_App_bufp = Em_App_msg.data; | ||
417 | - Em_App_desc = "*\xe5[1]"; | ||
418 | - DUREX_data_fetch(&val); | ||
419 | - Em_App_marshallToBuf(); | ||
420 | -#else | ||
421 | - DUREX_data_fetch((void*)Em_App_msg.data); | ||
422 | -#endif | ||
423 | - size = 229; | ||
424 | - break; | ||
425 | - } | ||
426 | - case 3: { | ||
427 | -#ifdef Em_16BIT | ||
428 | - DUREX_numPackets_t val; | ||
429 | - Em_App_valp = (uint8_t*)&val; | ||
430 | - Em_App_bufp = Em_App_msg.data; | ||
431 | - Em_App_desc = "1"; | ||
432 | - DUREX_numPackets_fetch(&val); | ||
433 | - Em_App_marshallToBuf(); | ||
434 | -#else | ||
435 | - DUREX_numPackets_fetch((void*)Em_App_msg.data); | ||
436 | -#endif | ||
437 | - size = 1; | ||
438 | - break; | ||
439 | - } | ||
440 | - case 4: { | ||
441 | -#ifdef Em_16BIT | ||
442 | - DUREX_messageAvailable_t val; | ||
443 | - Em_App_valp = (uint8_t*)&val; | ||
444 | - Em_App_bufp = Em_App_msg.data; | ||
445 | - Em_App_desc = "1"; | ||
446 | - DUREX_messageAvailable_fetch(&val); | ||
447 | - Em_App_marshallToBuf(); | ||
448 | -#else | ||
449 | - DUREX_messageAvailable_fetch((void*)Em_App_msg.data); | ||
450 | -#endif | ||
451 | - size = 1; | ||
452 | - break; | ||
453 | - } | ||
454 | - } | ||
455 | - Em_App_sendResponse(Em_Message_FETCH_DONE, size); | ||
456 | -} | ||
457 | - | ||
458 | -void Em_App_storeDispatch(void) { | ||
459 | - switch (Em_App_msg.hdr.resId) { | ||
460 | - case 0: { | ||
461 | - break; | ||
462 | - } | ||
463 | - case 1: { | ||
464 | -#ifdef Em_16BIT | ||
465 | - DUREX_numBytes_t val; | ||
466 | - Em_App_valp = (uint8_t*)&val; | ||
467 | - Em_App_bufp = Em_App_msg.data; | ||
468 | - Em_App_desc = "1"; | ||
469 | - Em_App_marshallToVal(); | ||
470 | - DUREX_numBytes_store(&val); | ||
471 | -#else | ||
472 | - DUREX_numBytes_store((void*)Em_App_msg.data); | ||
473 | -#endif | ||
474 | - break; | ||
475 | - } | ||
476 | - case 2: { | ||
477 | -#ifdef Em_16BIT | ||
478 | - DUREX_data_t val; | ||
479 | - Em_App_valp = (uint8_t*)&val; | ||
480 | - Em_App_bufp = Em_App_msg.data; | ||
481 | - Em_App_desc = "*\xe5[1]"; | ||
482 | - Em_App_marshallToVal(); | ||
483 | - DUREX_data_store(&val); | ||
484 | -#else | ||
485 | - DUREX_data_store((void*)Em_App_msg.data); | ||
486 | -#endif | ||
487 | - break; | ||
488 | - } | ||
489 | - case 3: { | ||
490 | -#ifdef Em_16BIT | ||
491 | - DUREX_numPackets_t val; | ||
492 | - Em_App_valp = (uint8_t*)&val; | ||
493 | - Em_App_bufp = Em_App_msg.data; | ||
494 | - Em_App_desc = "1"; | ||
495 | - Em_App_marshallToVal(); | ||
496 | - DUREX_numPackets_store(&val); | ||
497 | -#else | ||
498 | - DUREX_numPackets_store((void*)Em_App_msg.data); | ||
499 | -#endif | ||
500 | - break; | ||
501 | - } | ||
502 | - } | ||
503 | - Em_App_sendResponse(Em_Message_STORE_DONE, 0); | ||
504 | -} | ||
505 | - | ||
506 | -void Em_App_sendIndicator(Em_Message_ResId indId) { | ||
507 | - Em_Message_Size resId = 0; | ||
508 | - Em_Message_Size size = 0; | ||
509 | - switch (indId) { | ||
510 | - case 1: { | ||
511 | -#ifdef Em_16BIT | ||
512 | - DUREX_messageAvailable_t val; | ||
513 | - Em_App_valp = (uint8_t*)&val; | ||
514 | - Em_App_bufp = Em_App_ind.data; | ||
515 | - Em_App_desc = "1"; | ||
516 | - DUREX_messageAvailable_fetch(&val); | ||
517 | - Em_App_marshallToBuf(); | ||
518 | -#else | ||
519 | - DUREX_messageAvailable_fetch((DUREX_messageAvailable_t*)&Em_App_ind.data); | ||
520 | -#endif | ||
521 | - resId = 4; | ||
522 | - size = 1; | ||
523 | - break; | ||
524 | - } | ||
525 | - } | ||
526 | - Em_App_ind.sot = 0; | ||
527 | - Em_App_ind.hdr.kind = Em_Message_INDICATOR; | ||
528 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header) + size; | ||
529 | - Em_App_ind.hdr.resId = resId; | ||
530 | - Em_App_startIndSend(); | ||
531 | -} | ||
532 | - | ||
533 | -void DUREX_messageAvailable_indicate(void) { | ||
534 | - if (Em_App_state == Em_App_CONNECTED && Em_App_xmitReady(1 + 1)) Em_App_sendIndicator(1); | ||
535 | -} | ||
536 | - | ||
537 | -#ifdef __cplusplus | ||
538 | -} | ||
539 | -#endif | ||
540 | - |
DUREX/Em/DUREX.h deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T16:44:10T ****/ | ||
2 | -/**** protocolLevel = 13, toolsVersion = 13.4.1.201311121909 ****/ | ||
3 | - | ||
4 | -#ifndef DUREX__H | ||
5 | -#define DUREX__H | ||
6 | - | ||
7 | -#include "Em_Types.h" | ||
8 | -#include "Em_Message.h" | ||
9 | - | ||
10 | -#ifdef __cplusplus | ||
11 | -extern "C" { | ||
12 | -#endif | ||
13 | - | ||
14 | -/* -------- connection callback functions implemented by the application -------- */ | ||
15 | - | ||
16 | -void DUREX_connectHandler(void); | ||
17 | -void DUREX_disconnectHandler(void); | ||
18 | - | ||
19 | -/* -------- resource types defined in the schema -------- */ | ||
20 | - | ||
21 | -/* typedef String */ | ||
22 | -typedef char DUREX_String[229]; | ||
23 | -#define DUREX_String_length 229 | ||
24 | - | ||
25 | -/* enum BOOLEAN */ | ||
26 | -typedef uint8_t DUREX_BOOLEAN; | ||
27 | -#define DUREX_TRUE 0 | ||
28 | -#define DUREX_FALSE 1 | ||
29 | - | ||
30 | -/* -------- resource callback functions implemented by the application -------- */ | ||
31 | - | ||
32 | -/* resource numBytes */ | ||
33 | -typedef uint8_t DUREX_numBytes_t; | ||
34 | -extern void DUREX_numBytes_fetch(DUREX_numBytes_t* output); | ||
35 | -extern void DUREX_numBytes_store(DUREX_numBytes_t* input); | ||
36 | - | ||
37 | -/* resource data */ | ||
38 | -typedef DUREX_String DUREX_data_t; | ||
39 | -extern void DUREX_data_fetch(DUREX_data_t output); | ||
40 | -extern void DUREX_data_store(DUREX_data_t input); | ||
41 | - | ||
42 | -/* resource numPackets */ | ||
43 | -typedef uint8_t DUREX_numPackets_t; | ||
44 | -extern void DUREX_numPackets_fetch(DUREX_numPackets_t* output); | ||
45 | -extern void DUREX_numPackets_store(DUREX_numPackets_t* input); | ||
46 | - | ||
47 | -/* resource messageAvailable */ | ||
48 | -typedef DUREX_BOOLEAN DUREX_messageAvailable_t; | ||
49 | -extern void DUREX_messageAvailable_fetch(DUREX_messageAvailable_t* output); | ||
50 | -extern void DUREX_messageAvailable_indicate(void); /* called by the application */ | ||
51 | - | ||
52 | -/* -------- application functions implemented in DUREX.c -------- */ | ||
53 | - | ||
54 | -void DUREX_accept(bool enable); | ||
55 | -void DUREX_activateParameters(uint8_t group); | ||
56 | -void DUREX_broadcastOff(void); | ||
57 | -void DUREX_disconnect(void); | ||
58 | -void DUREX_pairingOn(uint8_t secs, void(*handler)(void)); | ||
59 | -void DUREX_pairingOff(void(*handler)(void)); | ||
60 | -void DUREX_reset(void); | ||
61 | -void DUREX_setDeviceName(const char* name); | ||
62 | -void DUREX_start(void); | ||
63 | - | ||
64 | -#ifdef __cplusplus | ||
65 | -} | ||
66 | -#endif | ||
67 | - | ||
68 | -#endif /* DUREX__H */ |
DUREX/Em/Em_Message.h deleted
1 | -#ifndef Em_Message_H_ | ||
2 | -#define Em_Message_H_ | ||
3 | - | ||
4 | -#include "Em_Types.h" | ||
5 | - | ||
6 | -#ifdef __cplusplus | ||
7 | -extern "C" { | ||
8 | -#endif | ||
9 | - | ||
10 | -/* -------- SRT FUNCTIONS CALLED BY HAL -------- */ | ||
11 | - | ||
12 | -static inline bool Em_Message_addByte(uint8_t b); | ||
13 | -extern void Em_Message_dispatch(void); | ||
14 | -static inline bool Em_Message_getByte(uint8_t* bp); | ||
15 | -extern void Em_Message_restart(void); | ||
16 | -static inline bool Em_Message_startRx(void); | ||
17 | -static inline uint8_t Em_Message_startTx(void); | ||
18 | - | ||
19 | - | ||
20 | -/* -------- HAL FUNCTIONS CALLED BY SRT -------- */ | ||
21 | - | ||
22 | -extern uint8_t Em_Hal_lock(void); | ||
23 | -extern void Em_Hal_reset(void); | ||
24 | -extern void Em_Hal_startSend(void); | ||
25 | -extern void Em_Hal_unlock(uint8_t key); | ||
26 | -extern void Em_Hal_watchOff(void); | ||
27 | -extern void Em_Hal_watchOn(void); | ||
28 | - | ||
29 | - | ||
30 | -/* -------- MESSAGE FORMAT -------- */ | ||
31 | - | ||
32 | -/* protocolLevel #4 */ | ||
33 | -#define Em_Message_INDSIZE 4 | ||
34 | - | ||
35 | -typedef uint8_t Em_Message_Size; | ||
36 | -typedef uint8_t Em_Message_Kind; | ||
37 | -/* protocolLevel #12 -- split 16-bit resId into <resId, chan> */ | ||
38 | -typedef uint8_t Em_Message_ResId; | ||
39 | -typedef uint8_t Em_Message_Chan; | ||
40 | - | ||
41 | -#define Em_Message_NOP 0 | ||
42 | -#define Em_Message_FETCH 1 | ||
43 | -#define Em_Message_FETCH_DONE 2 | ||
44 | -#define Em_Message_STORE 3 | ||
45 | -#define Em_Message_STORE_DONE 4 | ||
46 | -#define Em_Message_INDICATOR 5 | ||
47 | -#define Em_Message_CONNECT 6 | ||
48 | -#define Em_Message_DISCONNECT 7 | ||
49 | -#define Em_Message_ECHO 8 | ||
50 | -/* protocolLevel #3 */ | ||
51 | -/* protocolLevel #6 -- rename from BROADCAST to PAIRING */ | ||
52 | -#define Em_Message_PAIRING 9 | ||
53 | -#define Em_Message_PAIRING_DONE 10 | ||
54 | -/* protocolLevel #7 */ | ||
55 | -#define Em_Message_OFFLINE 11 | ||
56 | -/* protocolLevel #8 */ | ||
57 | -#define Em_Message_ACCEPT 12 | ||
58 | -/* protocolLevel #13 */ | ||
59 | -#define Em_Message_START 13 | ||
60 | -#define Em_Message_ACTIVE_PARAMS 14 | ||
61 | - | ||
62 | -typedef struct Em_Message_Header { | ||
63 | - Em_Message_Size size; | ||
64 | - Em_Message_Kind kind; | ||
65 | - Em_Message_ResId resId; | ||
66 | - Em_Message_Chan chan; | ||
67 | -} Em_Message_Header; | ||
68 | - | ||
69 | -typedef uint16_t Em_Message_protocolLevel_t; | ||
70 | - | ||
71 | -/* protocolLevel #1 */ | ||
72 | - | ||
73 | -/* protocolLevel #10 */ | ||
74 | -/* #define Em_Message_SYS_SCHEMA_UUID 0xFF */ | ||
75 | - | ||
76 | -#define Em_Message_SYS_MCM_PROTOCOL_LEVEL 0xFE | ||
77 | -#define Em_Message_SYS_EAP_PROTOCOL_LEVEL 0xFD | ||
78 | -#define Em_Message_SYS_EAP_BUILD_DATE 0xFC | ||
79 | - | ||
80 | -/* protocolLevel #2 */ | ||
81 | -#define Em_Message_SYS_FILE_INDEX_RESET 0xFB | ||
82 | - | ||
83 | -/* protocolLevel #5 */ | ||
84 | -#define Em_Message_SYS_SCHEMA_HASH 0xFA | ||
85 | - | ||
86 | -/* protocolLevel #7 */ | ||
87 | -#define Em_Message_SYS_RESOURCE_COUNT 0xF9 | ||
88 | - | ||
89 | -/* protocolLevel #9 */ | ||
90 | -#define Em_Message_SYS_MOBILE_RSSI 0xF8 | ||
91 | - | ||
92 | -/* protocolLevel #11 */ | ||
93 | -#define Em_Message_SYS_MCM_DISCONNECT 0xF7 | ||
94 | - | ||
95 | -/* protocolLevel #13a */ | ||
96 | -#define Em_Message_SYS_MCM_NAME 0xF5 | ||
97 | - | ||
98 | - | ||
99 | -/* -------- PRIVATE -------- */ | ||
100 | - | ||
101 | -extern void Em_Message_nextXmit(void); | ||
102 | - | ||
103 | -extern uint8_t* Em_App_inBuf; | ||
104 | -extern uint8_t* Em_App_outBuf; | ||
105 | -extern Em_Message_Size Em_App_xmitSize; | ||
106 | - | ||
107 | -extern uint8_t* _Em_Message_rxBuf; | ||
108 | -extern uint8_t _Em_Message_rxCnt; | ||
109 | - | ||
110 | -extern uint8_t* _Em_Message_txBuf; | ||
111 | -extern uint8_t _Em_Message_txCnt; | ||
112 | - | ||
113 | -static inline bool Em_Message_addByte(uint8_t b) { | ||
114 | - if (_Em_Message_rxCnt == 0) { | ||
115 | - if (b == 0) { | ||
116 | - return false; | ||
117 | - } | ||
118 | - _Em_Message_rxCnt = b; | ||
119 | - } | ||
120 | - *_Em_Message_rxBuf++ = b; | ||
121 | - if (--_Em_Message_rxCnt == 0) { | ||
122 | - _Em_Message_rxBuf = 0; | ||
123 | - if (_Em_Message_txBuf == 0) { | ||
124 | - Em_Hal_watchOff(); | ||
125 | - } | ||
126 | - return true; | ||
127 | - } | ||
128 | - else { | ||
129 | - return false; | ||
130 | - } | ||
131 | -} | ||
132 | - | ||
133 | -static inline bool Em_Message_getByte(uint8_t* bp) { | ||
134 | - if (_Em_Message_txBuf == 0) { | ||
135 | - return false; | ||
136 | - } | ||
137 | - if (_Em_Message_txCnt == 0) { | ||
138 | - _Em_Message_txCnt = *_Em_Message_txBuf + 1; | ||
139 | - } | ||
140 | - if (--_Em_Message_txCnt > 0) { | ||
141 | - *bp = *_Em_Message_txBuf++; | ||
142 | - return true; | ||
143 | - } | ||
144 | - else { | ||
145 | - _Em_Message_txBuf = 0; | ||
146 | - Em_App_xmitSize = 0; | ||
147 | - Em_Message_nextXmit(); | ||
148 | - if (_Em_Message_rxBuf == 0) { | ||
149 | - Em_Hal_watchOff(); | ||
150 | - } | ||
151 | - return false; | ||
152 | - } | ||
153 | -} | ||
154 | - | ||
155 | -static inline bool Em_Message_startRx(void) { | ||
156 | - if (_Em_Message_rxBuf == 0) { | ||
157 | - _Em_Message_rxBuf = Em_App_inBuf; | ||
158 | - if (_Em_Message_txBuf == 0) { | ||
159 | - Em_Hal_watchOn(); | ||
160 | - } | ||
161 | - return true; | ||
162 | - } | ||
163 | - else { | ||
164 | - return false; | ||
165 | - } | ||
166 | -} | ||
167 | - | ||
168 | -static inline uint8_t Em_Message_startTx(void) { | ||
169 | - _Em_Message_txBuf = Em_App_outBuf + 1; | ||
170 | - _Em_Message_txCnt = 0; | ||
171 | - if (_Em_Message_rxBuf == 0) { | ||
172 | - Em_Hal_watchOn(); | ||
173 | - } | ||
174 | - return 0; | ||
175 | -} | ||
176 | - | ||
177 | - | ||
178 | -#ifdef __cplusplus | ||
179 | -} | ||
180 | -#endif | ||
181 | - | ||
182 | -#endif /*Em_Message_H_*/ |
DUREX/Em/Em_Types.h deleted
1 | -#ifndef Em_Types_H_ | ||
2 | -#define Em_Types_H_ | ||
3 | - | ||
4 | -#ifndef Em_NOSTDBOOL | ||
5 | -#include <stdbool.h> | ||
6 | -#endif | ||
7 | - | ||
8 | -#ifndef Em_NOSTDINT | ||
9 | -#include <stdint.h> | ||
10 | -#endif | ||
11 | - | ||
12 | -#ifdef Em_16BIT | ||
13 | -typedef signed char int8_t; | ||
14 | -typedef unsigned char uint8_t; | ||
15 | -#endif | ||
16 | - | ||
17 | -#endif /*Em_Types_H_*/ |
DUREX/Em/durex.json deleted
1 | -{ | ||
2 | - "resources": { | ||
3 | - "$eapProtocolLevel": { | ||
4 | - "id": -3, | ||
5 | - "align": 2, | ||
6 | - "attributes": {"readonly": true}, | ||
7 | - "type": "u2", | ||
8 | - "access": "r", | ||
9 | - "size": 2 | ||
10 | - }, | ||
11 | - "numBytes": { | ||
12 | - "id": 1, | ||
13 | - "align": 1, | ||
14 | - "attributes": {}, | ||
15 | - "type": "u1", | ||
16 | - "access": "rw", | ||
17 | - "size": 1 | ||
18 | - }, | ||
19 | - "data": { | ||
20 | - "id": 2, | ||
21 | - "align": 1, | ||
22 | - "attributes": {}, | ||
23 | - "type": "C:229", | ||
24 | - "access": "rw", | ||
25 | - "size": 229 | ||
26 | - }, | ||
27 | - "$activeGroup": { | ||
28 | - "id": -10, | ||
29 | - "align": 1, | ||
30 | - "pack": 1, | ||
31 | - "attributes": {"readwrite": true}, | ||
32 | - "type": "E:system@emmoco.com.System/ParameterGroup", | ||
33 | - "access": "rw", | ||
34 | - "size": 1 | ||
35 | - }, | ||
36 | - "$mcmDisconnect": { | ||
37 | - "id": -9, | ||
38 | - "align": 1, | ||
39 | - "attributes": {"writeonly": true}, | ||
40 | - "type": "u1", | ||
41 | - "access": "w", | ||
42 | - "size": 1 | ||
43 | - }, | ||
44 | - "$eapBuildDate": { | ||
45 | - "dim": 8, | ||
46 | - "id": -4, | ||
47 | - "align": 1, | ||
48 | - "attributes": {"readonly": true}, | ||
49 | - "type": "A8:u1", | ||
50 | - "access": "r", | ||
51 | - "size": 8 | ||
52 | - }, | ||
53 | - "numPackets": { | ||
54 | - "id": 3, | ||
55 | - "align": 1, | ||
56 | - "attributes": {}, | ||
57 | - "type": "u1", | ||
58 | - "access": "rw", | ||
59 | - "size": 1 | ||
60 | - }, | ||
61 | - "$resourceCount": { | ||
62 | - "id": -7, | ||
63 | - "align": 1, | ||
64 | - "attributes": {"readonly": true}, | ||
65 | - "type": "S:system@emmoco.com.System/ResourceCount", | ||
66 | - "access": "r", | ||
67 | - "size": 2 | ||
68 | - }, | ||
69 | - "$schemaHash": { | ||
70 | - "dim": 20, | ||
71 | - "id": -6, | ||
72 | - "align": 1, | ||
73 | - "attributes": {"readonly": true}, | ||
74 | - "type": "A20:u1", | ||
75 | - "access": "r", | ||
76 | - "size": 20 | ||
77 | - }, | ||
78 | - "messageAvailable": { | ||
79 | - "id": 4, | ||
80 | - "align": 1, | ||
81 | - "pack": 1, | ||
82 | - "attributes": {"indicator": true}, | ||
83 | - "type": "E:@emmoco.com.DUREX/BOOLEAN", | ||
84 | - "access": "ir", | ||
85 | - "size": 1 | ||
86 | - }, | ||
87 | - "$mcmProtocolLevel": { | ||
88 | - "id": -2, | ||
89 | - "align": 2, | ||
90 | - "attributes": {"readonly": true}, | ||
91 | - "type": "u2", | ||
92 | - "access": "r", | ||
93 | - "size": 2 | ||
94 | - }, | ||
95 | - "$mobileRssi": { | ||
96 | - "id": -8, | ||
97 | - "align": 1, | ||
98 | - "attributes": {"readonly": true}, | ||
99 | - "type": "i1", | ||
100 | - "access": "r", | ||
101 | - "size": 1 | ||
102 | - }, | ||
103 | - "$fileIndexReset": { | ||
104 | - "id": -5, | ||
105 | - "align": 2, | ||
106 | - "attributes": {"writeonly": true}, | ||
107 | - "type": "i2", | ||
108 | - "access": "w", | ||
109 | - "size": 2 | ||
110 | - } | ||
111 | - }, | ||
112 | - "resourceNamesSys": [ | ||
113 | - "$activeGroup", | ||
114 | - "$eapBuildDate", | ||
115 | - "$eapProtocolLevel", | ||
116 | - "$fileIndexReset", | ||
117 | - "$mcmDisconnect", | ||
118 | - "$mcmProtocolLevel", | ||
119 | - "$mobileRssi", | ||
120 | - "$resourceCount", | ||
121 | - "$schemaHash" | ||
122 | - ], | ||
123 | - "manifest": { | ||
124 | - "protocolLevel": 13, | ||
125 | - "hash": [ | ||
126 | - 28, | ||
127 | - 106, | ||
128 | - 83, | ||
129 | - 11, | ||
130 | - 248, | ||
131 | - 159, | ||
132 | - 192, | ||
133 | - 243, | ||
134 | - 66, | ||
135 | - 193, | ||
136 | - 233, | ||
137 | - 148, | ||
138 | - 55, | ||
139 | - 208, | ||
140 | - 191, | ||
141 | - 77 | ||
142 | - ], | ||
143 | - "toolVersion": "13.4.1.201311121909", | ||
144 | - "name": "DUREX", | ||
145 | - "$$md5": "1c6a530bf89fc0f342c1e99437d0bf4d", | ||
146 | - "build": [ | ||
147 | - 208, | ||
148 | - 202, | ||
149 | - 48, | ||
150 | - 251, | ||
151 | - 69, | ||
152 | - 1, | ||
153 | - 0, | ||
154 | - 0 | ||
155 | - ], | ||
156 | - "date": "2014-05-14T16:44:10T", | ||
157 | - "maxAlign": 2, | ||
158 | - "maxSize": 229, | ||
159 | - "version": "1.0.0" | ||
160 | - }, | ||
161 | - "resourceNames": [ | ||
162 | - "numBytes", | ||
163 | - "data", | ||
164 | - "numPackets", | ||
165 | - "messageAvailable", | ||
166 | - "$mcmProtocolLevel", | ||
167 | - "$eapProtocolLevel", | ||
168 | - "$eapBuildDate", | ||
169 | - "$fileIndexReset", | ||
170 | - "$schemaHash", | ||
171 | - "$resourceCount", | ||
172 | - "$mobileRssi", | ||
173 | - "$mcmDisconnect", | ||
174 | - "$activeGroup" | ||
175 | - ], | ||
176 | - "attributes": { | ||
177 | - "description": "", | ||
178 | - "version": "1.0.0" | ||
179 | - }, | ||
180 | - "resourceNamesApp": [ | ||
181 | - "numBytes", | ||
182 | - "data", | ||
183 | - "numPackets", | ||
184 | - "messageAvailable" | ||
185 | - ], | ||
186 | - "types": { | ||
187 | - "system@emmoco.com.System/ResourceCount": { | ||
188 | - "packed": false, | ||
189 | - "align": 1, | ||
190 | - "type": "S:system@emmoco.com.System/ResourceCount", | ||
191 | - "size": 2, | ||
192 | - "fields": [ | ||
193 | - { | ||
194 | - "pad": 0, | ||
195 | - "align": 1, | ||
196 | - "name": "app", | ||
197 | - "type": "u1", | ||
198 | - "size": 1 | ||
199 | - }, | ||
200 | - { | ||
201 | - "pad": 0, | ||
202 | - "align": 1, | ||
203 | - "name": "sys", | ||
204 | - "type": "u1", | ||
205 | - "size": 1 | ||
206 | - } | ||
207 | - ] | ||
208 | - }, | ||
209 | - "std:i2": { | ||
210 | - "align": 2, | ||
211 | - "size": 2 | ||
212 | - }, | ||
213 | - "std:i1": { | ||
214 | - "align": 1, | ||
215 | - "size": 1 | ||
216 | - }, | ||
217 | - "std:u1": { | ||
218 | - "align": 1, | ||
219 | - "size": 1 | ||
220 | - }, | ||
221 | - "@emmoco.com.DUREX/BOOLEAN": { | ||
222 | - "values": [ | ||
223 | - "TRUE", | ||
224 | - "FALSE" | ||
225 | - ], | ||
226 | - "align": 1, | ||
227 | - "pack": 1, | ||
228 | - "type": "E:@emmoco.com.DUREX/BOOLEAN", | ||
229 | - "size": 1 | ||
230 | - }, | ||
231 | - "system@emmoco.com.System/ParameterGroup": { | ||
232 | - "values": [ | ||
233 | - "GROUP_A", | ||
234 | - "GROUP_B" | ||
235 | - ], | ||
236 | - "align": 1, | ||
237 | - "pack": 1, | ||
238 | - "type": "E:system@emmoco.com.System/ParameterGroup", | ||
239 | - "size": 1 | ||
240 | - }, | ||
241 | - "std:u2": { | ||
242 | - "align": 2, | ||
243 | - "size": 2 | ||
244 | - } | ||
245 | - }, | ||
246 | - "imports": {"@emmoco.com.DUREX": true} | ||
247 | -} | ||
248 | \ No newline at end of file | 0 | \ No newline at end of file |
DUREX/Schema-Imports/system@emmoco.com/System.ems deleted
1 | -owner = "system@emmoco.com" | ||
2 | - | ||
3 | -schema System { | ||
4 | - | ||
5 | - // protocolLevel #13 | ||
6 | - | ||
7 | - enum ParameterGroup { | ||
8 | - GROUP_A, GROUP_B | ||
9 | - } | ||
10 | - | ||
11 | - // protocolLevel #1 | ||
12 | - | ||
13 | - uint8 $schemaUuid[16] { // protocolLevel #10 -- invisible to applications | ||
14 | - readonly | ||
15 | - } | ||
16 | - | ||
17 | - uint16 $mcmProtocolLevel { | ||
18 | - readonly | ||
19 | - } | ||
20 | - | ||
21 | - uint16 $eapProtocolLevel { | ||
22 | - readonly | ||
23 | - } | ||
24 | - | ||
25 | - uint8 $eapBuildDate[8] { // protocolLevel #5 -- rename from $eapBuildNumber | ||
26 | - readonly | ||
27 | - } | ||
28 | - | ||
29 | - // protocolLevel #2 | ||
30 | - | ||
31 | - int16 $fileIndexReset { | ||
32 | - writeonly | ||
33 | - } | ||
34 | - | ||
35 | - // protocolLevel #5 | ||
36 | - | ||
37 | - // protocolLevel #12 -- increase size to 20 | ||
38 | - | ||
39 | - uint8 $schemaHash[20] { | ||
40 | - readonly | ||
41 | - } | ||
42 | - | ||
43 | - // protocolLevel #7 | ||
44 | - | ||
45 | - struct ResourceCount { | ||
46 | - uint8 app | ||
47 | - uint8 sys | ||
48 | - } | ||
49 | - | ||
50 | - ResourceCount $resourceCount { | ||
51 | - readonly | ||
52 | - } | ||
53 | - | ||
54 | - // protocolLevel #9 | ||
55 | - | ||
56 | - int8 $mobileRssi { | ||
57 | - readonly | ||
58 | - } | ||
59 | - | ||
60 | - // protocolLevel #11 | ||
61 | - | ||
62 | - uint8 $mcmDisconnect { | ||
63 | - writeonly | ||
64 | - } | ||
65 | - | ||
66 | - // protocolLevel #13 | ||
67 | - | ||
68 | - ParameterGroup $activeGroup { | ||
69 | - readwrite | ||
70 | - } | ||
71 | - | ||
72 | -} |
DUREX/bundle.properties deleted
1 | -# generated file - do not edit | ||
2 | - | ||
3 | -bundle.requires = com.emmoco.schema.translator | ||
4 | -com.emmoco.framework.Properties.applicationDirectory = Em | ||
5 | -com.emmoco.framework.Properties.schemaDestinationDirectory = Em | ||
6 | -com.emmoco.framework.Properties.serverAPIToken = | ||
7 | -com.emmoco.framework.Properties.align16 = 2 | ||
8 | -com.emmoco.framework.Properties.align32 = 4 | ||
9 | -com.emmoco.framework.Properties.schemaFile = /Users/imanol/devel/durex/DUREX/schema.ems | ||
10 | -com.emmoco.framework.Properties.toolVersion = 13.4.1.201311121909 |
DUREX/imports/system@emmoco.com/System.ems deleted
1 | -owner = "system@emmoco.com" | ||
2 | - | ||
3 | -schema System { | ||
4 | - | ||
5 | - // protocolLevel #1 | ||
6 | - | ||
7 | - uint8 $schemaUuid[16] { // protocolLevel #10 -- invisible to applications | ||
8 | - readonly | ||
9 | - } | ||
10 | - | ||
11 | - uint16 $mcmProtocolLevel { | ||
12 | - readonly | ||
13 | - } | ||
14 | - | ||
15 | - uint16 $eapProtocolLevel { | ||
16 | - readonly | ||
17 | - } | ||
18 | - | ||
19 | - uint8 $eapBuildDate[8] { // protocolLevel #5 -- rename from $eapBuildNumber | ||
20 | - readonly | ||
21 | - } | ||
22 | - | ||
23 | - // protocolLevel #2 | ||
24 | - | ||
25 | - int16 $fileIndexReset { | ||
26 | - writeonly | ||
27 | - } | ||
28 | - | ||
29 | - // protocolLevel #5 | ||
30 | - | ||
31 | - // protocolLevel #12 -- increase size to 20 | ||
32 | - | ||
33 | - uint8 $schemaHash[20] { | ||
34 | - readonly | ||
35 | - } | ||
36 | - | ||
37 | - // protocolLevel #7 | ||
38 | - | ||
39 | - struct ResourceCount { | ||
40 | - uint8 app | ||
41 | - uint8 sys | ||
42 | - } | ||
43 | - | ||
44 | - ResourceCount $resourceCount { | ||
45 | - readonly | ||
46 | - } | ||
47 | - | ||
48 | - // protocolLevel #9 | ||
49 | - | ||
50 | - int8 $mobileRssi { | ||
51 | - readonly | ||
52 | - } | ||
53 | - | ||
54 | - // protocolLevel #11 | ||
55 | - | ||
56 | - uint8 $mcmDisconnect { | ||
57 | - writeonly | ||
58 | - } | ||
59 | - | ||
60 | -} |
DUREX/out/DUREX-TODO.c deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T13:18:01T ****/ | ||
2 | -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ | ||
3 | - | ||
4 | -#include "DUREX.h" | ||
5 | - | ||
6 | -#ifdef Em_DUREX_TODO /* enables optional inclusion of empty functions */ | ||
7 | - | ||
8 | -/* Copy the function skeletons below into your own DUREX.c source file */ | ||
9 | - | ||
10 | -void DUREX_connectHandler(void) { | ||
11 | - /* TODO: application is now connected */ | ||
12 | -} | ||
13 | - | ||
14 | -void DUREX_disconnectHandler(void) { | ||
15 | - /* TODO: application is now disconnected */ | ||
16 | -} | ||
17 | - | ||
18 | -void DUREX_numBytes_fetch(DUREX_numBytes_t* const output) { | ||
19 | - /* TODO: write resource 'numBytes' into 'output' */ | ||
20 | -} | ||
21 | - | ||
22 | -void DUREX_numBytes_store(DUREX_numBytes_t* const input) { | ||
23 | - /* TODO: read resource 'numBytes' from 'input' */ | ||
24 | -} | ||
25 | - | ||
26 | -void DUREX_data_fetch(DUREX_data_t* const output) { | ||
27 | - /* TODO: write resource 'data' into 'output' */ | ||
28 | -} | ||
29 | - | ||
30 | -void DUREX_data_store(DUREX_data_t* const input) { | ||
31 | - /* TODO: read resource 'data' from 'input' */ | ||
32 | -} | ||
33 | - | ||
34 | -void DUREX_numPackets_fetch(DUREX_numPackets_t* const output) { | ||
35 | - /* TODO: write resource 'numPackets' into 'output' */ | ||
36 | -} | ||
37 | - | ||
38 | -void DUREX_numPackets_store(DUREX_numPackets_t* const input) { | ||
39 | - /* TODO: read resource 'numPackets' from 'input' */ | ||
40 | -} | ||
41 | - | ||
42 | -void DUREX_messageAvailable_fetch(DUREX_messageAvailable_t* const output) { | ||
43 | - /* TODO: write resource 'messageAvailable' into 'output' */ | ||
44 | -} | ||
45 | - | ||
46 | -void DUREX_messageAvailable_store(DUREX_messageAvailable_t* const input) { | ||
47 | - /* TODO: read resource 'messageAvailable' from 'input' */ | ||
48 | -} | ||
49 | - | ||
50 | -#endif /* dummy file */ |
DUREX/out/DUREX.c deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T13:18:01T ****/ | ||
2 | -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ | ||
3 | - | ||
4 | -#include "Em_Message.h" | ||
5 | -#include "DUREX.h" | ||
6 | - | ||
7 | -#ifdef __cplusplus | ||
8 | -extern "C" { | ||
9 | -#endif | ||
10 | - | ||
11 | -#define Em_Message_protocolLevel 12 | ||
12 | - | ||
13 | -typedef struct Em_App_Message { | ||
14 | - uint8_t dummy; | ||
15 | - uint8_t sot; | ||
16 | - Em_Message_Header hdr; | ||
17 | - uint8_t data[229]; | ||
18 | -} Em_App_Message; | ||
19 | - | ||
20 | -const uint8_t Em_App_hash[] = {245, 13, 216, 92, 22, 189, 34, 32, 16, 124, 194, 50, 87, 152, 227, 110, 12, 0, ((sizeof(struct{uint8_t f1; uint16_t f2;}) - sizeof(uint16_t)) << 4) | (sizeof(struct{uint8_t f1; uint32_t f2;}) - sizeof(uint32_t))}; | ||
21 | - | ||
22 | -const uint8_t Em_App_build[] = {61, 15, 116, 250, 69, 1, 0, 0}; | ||
23 | - | ||
24 | -#define Em_App_APP_RESOURCE_COUNT 4 | ||
25 | -#define Em_App_SYS_RESOURCE_COUNT 8 | ||
26 | - | ||
27 | -#define Em_App_ACCEPT DUREX_accept | ||
28 | -#define Em_App_DISCONNECT DUREX_disconnect | ||
29 | -#define Em_App_PAIRINGON DUREX_pairingOn | ||
30 | -#define Em_App_PAIRINGOFF DUREX_pairingOff | ||
31 | -#define Em_App_RESET DUREX_reset | ||
32 | -#define Em_App_RUN DUREX_run | ||
33 | - | ||
34 | -#define Em_App_CONNECTHANDLER DUREX_connectHandler | ||
35 | -#define Em_App_DISCONNECTHANDLER DUREX_disconnectHandler | ||
36 | - | ||
37 | -#define Em_App_MAX_INDICATOR 2 | ||
38 | - | ||
39 | -enum {Em_App_IDLE, Em_App_DISCONNECTED, Em_App_CONNECTED}; | ||
40 | - | ||
41 | -typedef struct Em_App_Indicator { | ||
42 | - uint8_t dummy; | ||
43 | - uint8_t sot; | ||
44 | - Em_Message_Header hdr; | ||
45 | - uint8_t data[Em_Message_INDSIZE]; | ||
46 | -} Em_App_Indicator; | ||
47 | - | ||
48 | -void (*Em_App_pdHdlr)(void); | ||
49 | - | ||
50 | -const uint16_t Em_App_endian = 0x0100; | ||
51 | - | ||
52 | -Em_Message_Size Em_App_recvIdx; | ||
53 | -Em_Message_Size Em_App_recvSize; | ||
54 | -Em_Message_Size Em_App_xmitIdx; | ||
55 | -Em_Message_Size Em_App_xmitSize; | ||
56 | - | ||
57 | -uint8_t Em_App_state = Em_App_IDLE; | ||
58 | -Em_App_Message Em_App_msg; | ||
59 | -Em_App_Indicator Em_App_ind; | ||
60 | -bool Em_App_moreData = false; | ||
61 | -bool Em_App_readIdle = true; | ||
62 | -int32_t Em_App_fileIndex; | ||
63 | -uint32_t Em_App_xmitMask; | ||
64 | - | ||
65 | -uint8_t* Em_App_inBuf = (uint8_t*)&Em_App_msg.hdr; | ||
66 | -uint8_t* Em_App_outBuf; | ||
67 | - | ||
68 | -void Em_App_fetchDispatch(void); | ||
69 | -void Em_App_storeDispatch(void); | ||
70 | -void Em_App_sendIndicator(Em_Message_ResId indId); | ||
71 | -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size); | ||
72 | -void Em_App_startIndSend(void); | ||
73 | -void Em_App_startResSend(void); | ||
74 | -void Em_App_sysFetchDispatch(void); | ||
75 | -void Em_App_sysStoreDispatch(void); | ||
76 | -bool Em_App_xmitReady(Em_Message_ResId indId); | ||
77 | - | ||
78 | -bool Em_Message_addByte(uint8_t b) { | ||
79 | - if (Em_App_readIdle && b) { | ||
80 | - Em_App_recvSize = Em_App_inBuf[0] = b; | ||
81 | - Em_App_recvIdx = 1; | ||
82 | - Em_App_readIdle = false; | ||
83 | - return false; | ||
84 | - } | ||
85 | - Em_App_inBuf[Em_App_recvIdx++] = b; | ||
86 | - if (Em_App_recvIdx < Em_App_recvSize) { | ||
87 | - return false; | ||
88 | - } | ||
89 | - Em_App_readIdle = true; | ||
90 | - return true; | ||
91 | -} | ||
92 | - | ||
93 | -bool Em_Message_getByte(uint8_t* bp) { | ||
94 | - uint8_t key = Em_Message_lock(); | ||
95 | - Em_App_moreData = (Em_App_xmitSize != 0); | ||
96 | - if (!Em_App_moreData && (Em_App_xmitMask != 0)) { | ||
97 | - uint8_t i; | ||
98 | - uint32_t m; | ||
99 | - for (i = 0, m = 0x1; i < Em_App_MAX_INDICATOR; i++, m <<= 1) { | ||
100 | - if (Em_App_xmitMask & m) { | ||
101 | - Em_App_xmitMask &= ~m; | ||
102 | - if (i == 0) { | ||
103 | - Em_App_startResSend(); | ||
104 | - } | ||
105 | - else { | ||
106 | - Em_App_sendIndicator(i); | ||
107 | - } | ||
108 | - break; | ||
109 | - } | ||
110 | - } | ||
111 | - Em_Message_unlock(key); | ||
112 | - return false; | ||
113 | - } | ||
114 | - else if (Em_App_moreData) { | ||
115 | - *bp = Em_App_outBuf[Em_App_xmitIdx++]; | ||
116 | - Em_App_xmitSize -= 1; | ||
117 | - } | ||
118 | - Em_Message_unlock(key); | ||
119 | - return Em_App_moreData; | ||
120 | -} | ||
121 | - | ||
122 | -void Em_App_ACCEPT(bool enable) { | ||
123 | - if (Em_App_state == Em_App_CONNECTED) { | ||
124 | - return; | ||
125 | - } | ||
126 | - Em_App_ind.sot = 0; | ||
127 | - Em_App_ind.hdr.kind = Em_Message_ACCEPT; | ||
128 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
129 | - Em_App_ind.hdr.resId = enable; | ||
130 | - Em_App_startIndSend(); | ||
131 | -} | ||
132 | - | ||
133 | -void Em_App_DISCONNECT(void) { | ||
134 | - if (Em_App_state != Em_App_CONNECTED) { | ||
135 | - return; | ||
136 | - } | ||
137 | - Em_App_state = Em_App_DISCONNECTED; | ||
138 | - Em_App_ind.sot = 0; | ||
139 | - Em_App_ind.hdr.kind = Em_Message_DISCONNECT; | ||
140 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
141 | - Em_App_ind.hdr.resId = 0; | ||
142 | - Em_App_startIndSend(); | ||
143 | -} | ||
144 | - | ||
145 | -void Em_Message_dispatch(void) { | ||
146 | - if (Em_App_state == Em_App_IDLE) { | ||
147 | - return; | ||
148 | - } | ||
149 | - switch (Em_App_msg.hdr.kind) { | ||
150 | - case Em_Message_CONNECT: | ||
151 | - Em_App_state = Em_App_CONNECTED; | ||
152 | - Em_App_CONNECTHANDLER(); | ||
153 | - break; | ||
154 | - case Em_Message_DISCONNECT: | ||
155 | - Em_App_state = Em_App_DISCONNECTED; | ||
156 | - Em_App_DISCONNECTHANDLER(); | ||
157 | - break; | ||
158 | - case Em_Message_PAIRING_DONE: | ||
159 | - if (Em_App_pdHdlr) { | ||
160 | - (*Em_App_pdHdlr)(); | ||
161 | - } | ||
162 | - break; | ||
163 | - case Em_Message_FETCH: | ||
164 | - if (Em_App_msg.hdr.resId > 0) { | ||
165 | - Em_App_fetchDispatch(); | ||
166 | - } | ||
167 | - else { | ||
168 | - Em_App_sysFetchDispatch(); | ||
169 | - } | ||
170 | - break; | ||
171 | - case Em_Message_STORE: | ||
172 | - if (Em_App_msg.hdr.resId > 0) { | ||
173 | - Em_App_storeDispatch(); | ||
174 | - } | ||
175 | - else { | ||
176 | - Em_App_sysStoreDispatch(); | ||
177 | - } | ||
178 | - break; | ||
179 | - } | ||
180 | -} | ||
181 | - | ||
182 | -void Em_App_PAIRINGOFF(void(*handler)(void)) { | ||
183 | - Em_App_PAIRINGON(0, handler); | ||
184 | -} | ||
185 | - | ||
186 | -void Em_App_PAIRINGON(uint8_t secs, void(*handler)(void)) { | ||
187 | - if (Em_App_state != Em_App_DISCONNECTED) { | ||
188 | - return; | ||
189 | - } | ||
190 | - Em_App_pdHdlr = handler; | ||
191 | - Em_App_ind.sot = 0; | ||
192 | - Em_App_ind.hdr.kind = Em_Message_PAIRING; | ||
193 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header); | ||
194 | - Em_App_ind.hdr.resId = secs; | ||
195 | - Em_App_startIndSend(); | ||
196 | -} | ||
197 | - | ||
198 | -void Em_App_RESET(void) { | ||
199 | - Em_App_recvIdx = Em_App_recvSize = Em_App_xmitIdx = Em_App_xmitSize = 0; | ||
200 | - Em_App_state = Em_App_IDLE; | ||
201 | - Em_App_moreData = false; | ||
202 | - Em_App_readIdle = true; | ||
203 | - Em_App_fileIndex = 0; | ||
204 | - Em_App_xmitMask = 0; | ||
205 | -} | ||
206 | - | ||
207 | -void Em_App_RUN(void) { | ||
208 | - Em_App_state = Em_App_DISCONNECTED; | ||
209 | -} | ||
210 | - | ||
211 | -void Em_App_sendResponse(Em_Message_Kind kind, Em_Message_Size size) { | ||
212 | - if (Em_App_state != Em_App_CONNECTED) { | ||
213 | - return; | ||
214 | - } | ||
215 | - Em_App_msg.sot = 0; | ||
216 | - Em_App_msg.hdr.kind = kind; | ||
217 | - Em_App_msg.hdr.size = size + sizeof (Em_Message_Header); | ||
218 | - if (Em_App_xmitReady(0)) { | ||
219 | - Em_App_startResSend(); | ||
220 | - } | ||
221 | -} | ||
222 | - | ||
223 | -void Em_App_startIndSend(void) { | ||
224 | - Em_App_outBuf = (uint8_t*)&Em_App_ind.sot; | ||
225 | - Em_App_xmitSize = Em_App_ind.hdr.size + 1; | ||
226 | - Em_App_xmitIdx = 0; | ||
227 | - Em_Message_startSend(); | ||
228 | -} | ||
229 | - | ||
230 | -void Em_App_startResSend(void) { | ||
231 | - Em_App_outBuf = (uint8_t*)&Em_App_msg.sot; | ||
232 | - Em_App_xmitSize = Em_App_msg.hdr.size + 1; | ||
233 | - Em_App_xmitIdx = 0; | ||
234 | - Em_Message_startSend(); | ||
235 | -} | ||
236 | - | ||
237 | -void Em_App_sysFetchDispatch(void) { | ||
238 | - uint8_t size = 0; | ||
239 | - int i; | ||
240 | - switch (Em_App_msg.hdr.resId) { | ||
241 | - case Em_Message_SYS_SCHEMA_HASH: | ||
242 | - for (i = 0; i < sizeof (Em_App_hash); i++) { | ||
243 | - Em_App_msg.data[i] = Em_App_hash[i]; | ||
244 | - } | ||
245 | - Em_App_msg.data[sizeof (Em_App_hash)] = *((uint8_t*)&Em_App_endian); | ||
246 | - size = sizeof (Em_App_hash) + 1; | ||
247 | - break; | ||
248 | - case Em_Message_SYS_EAP_PROTOCOL_LEVEL: | ||
249 | - *((Em_Message_protocolLevel_t*)Em_App_msg.data) = Em_Message_protocolLevel; | ||
250 | - size = sizeof (Em_Message_protocolLevel_t); | ||
251 | - break; | ||
252 | - case Em_Message_SYS_EAP_BUILD_DATE: | ||
253 | - for (i = 0; i < sizeof (Em_App_build); i++) { | ||
254 | - Em_App_msg.data[i] = Em_App_build[i]; | ||
255 | - } | ||
256 | - size = sizeof (Em_App_build); | ||
257 | - break; | ||
258 | - case Em_Message_SYS_RESOURCE_COUNT: | ||
259 | - Em_App_msg.data[0] = Em_App_APP_RESOURCE_COUNT; | ||
260 | - Em_App_msg.data[1] = Em_App_SYS_RESOURCE_COUNT; | ||
261 | - size = 2; | ||
262 | - break; | ||
263 | - } | ||
264 | - Em_App_sendResponse(Em_Message_FETCH_DONE, size); | ||
265 | -} | ||
266 | - | ||
267 | -void Em_App_sysStoreDispatch(void) { | ||
268 | - switch (Em_App_msg.hdr.resId) { | ||
269 | - case Em_Message_SYS_FILE_INDEX_RESET: | ||
270 | - Em_App_fileIndex = 0; | ||
271 | - break; | ||
272 | - } | ||
273 | - Em_App_sendResponse(Em_Message_STORE_DONE, 0); | ||
274 | -} | ||
275 | - | ||
276 | -bool Em_App_xmitReady(Em_Message_ResId indId) { | ||
277 | - uint8_t key = Em_Message_lock(); | ||
278 | - bool res = !Em_App_moreData && Em_App_xmitMask == 0; | ||
279 | - if (!res) { | ||
280 | - Em_App_xmitMask |= (1 << indId); | ||
281 | - } | ||
282 | - Em_Message_unlock(key); | ||
283 | - return res; | ||
284 | -} | ||
285 | - | ||
286 | -void Em_App_fetchDispatch(void) { | ||
287 | - uint8_t size = 0; | ||
288 | - switch (Em_App_msg.hdr.resId) { | ||
289 | - case 0: | ||
290 | - break; | ||
291 | - case 1: | ||
292 | - DUREX_numBytes_fetch((DUREX_numBytes_t*)Em_App_msg.data); | ||
293 | - size = 1; | ||
294 | - break; | ||
295 | - case 2: | ||
296 | - DUREX_data_fetch((DUREX_data_t*)Em_App_msg.data); | ||
297 | - size = 229; | ||
298 | - break; | ||
299 | - case 3: | ||
300 | - DUREX_numPackets_fetch((DUREX_numPackets_t*)Em_App_msg.data); | ||
301 | - size = 1; | ||
302 | - break; | ||
303 | - case 4: | ||
304 | - DUREX_messageAvailable_fetch((DUREX_messageAvailable_t*)Em_App_msg.data); | ||
305 | - size = 1; | ||
306 | - break; | ||
307 | - } | ||
308 | - Em_App_sendResponse(Em_Message_FETCH_DONE, size); | ||
309 | -} | ||
310 | - | ||
311 | -void Em_App_storeDispatch(void) { | ||
312 | - switch (Em_App_msg.hdr.resId) { | ||
313 | - case 0: | ||
314 | - break; | ||
315 | - case 1: | ||
316 | - DUREX_numBytes_store((DUREX_numBytes_t*)Em_App_msg.data); | ||
317 | - break; | ||
318 | - case 2: | ||
319 | - DUREX_data_store((DUREX_data_t*)Em_App_msg.data); | ||
320 | - break; | ||
321 | - case 3: | ||
322 | - DUREX_numPackets_store((DUREX_numPackets_t*)Em_App_msg.data); | ||
323 | - break; | ||
324 | - case 4: | ||
325 | - DUREX_messageAvailable_store((DUREX_messageAvailable_t*)Em_App_msg.data); | ||
326 | - break; | ||
327 | - } | ||
328 | - Em_App_sendResponse(Em_Message_STORE_DONE, 0); | ||
329 | -} | ||
330 | - | ||
331 | -void Em_App_sendIndicator(Em_Message_ResId indId) { | ||
332 | - Em_Message_Size resId = 0; | ||
333 | - Em_Message_Size size = 0; | ||
334 | - switch (indId) { | ||
335 | - case 1: | ||
336 | - DUREX_messageAvailable_fetch((DUREX_messageAvailable_t*)&Em_App_ind.data); | ||
337 | - resId = 4; | ||
338 | - size = 1; | ||
339 | - break; | ||
340 | -} | ||
341 | - Em_App_ind.sot = 0; | ||
342 | - Em_App_ind.hdr.kind = Em_Message_INDICATOR; | ||
343 | - Em_App_ind.hdr.size = sizeof (Em_Message_Header) + size; | ||
344 | - Em_App_ind.hdr.resId = resId; | ||
345 | - Em_App_startIndSend(); | ||
346 | -} | ||
347 | - | ||
348 | -void DUREX_messageAvailable_indicate(void) { | ||
349 | - if (Em_App_state != Em_App_IDLE && Em_App_xmitReady(1)) Em_App_sendIndicator(1); | ||
350 | -} | ||
351 | - | ||
352 | -#ifdef __cplusplus | ||
353 | -} | ||
354 | -#endif | ||
355 | - |
DUREX/out/DUREX.h deleted
1 | -/**** DO NOT EDIT -- this file has been automatically generated from @emmoco.com.DUREX on 2014-05-14T13:18:01T ****/ | ||
2 | -/**** protocolLevel = 12, toolsVersion = 12.0.0.201211010336 ****/ | ||
3 | - | ||
4 | -#ifndef DUREX__H | ||
5 | -#define DUREX__H | ||
6 | - | ||
7 | -#include "Em_Types.h" | ||
8 | -#include "Em_Message.h" | ||
9 | - | ||
10 | -#ifdef __cplusplus | ||
11 | -extern "C" { | ||
12 | -#endif | ||
13 | - | ||
14 | -/* typedef String */ | ||
15 | -typedef char DUREX_String; | ||
16 | -#define DUREX_String_length 229 | ||
17 | - | ||
18 | -/* enum BOOLEAN */ | ||
19 | -typedef uint8_t DUREX_BOOLEAN; | ||
20 | -#define DUREX_TRUE 0 | ||
21 | -#define DUREX_FALSE 1 | ||
22 | - | ||
23 | -/* resource numBytes */ | ||
24 | -typedef uint8_t DUREX_numBytes_t; | ||
25 | -extern void DUREX_numBytes_fetch(DUREX_numBytes_t* const output); | ||
26 | -extern void DUREX_numBytes_store(DUREX_numBytes_t* const input); | ||
27 | - | ||
28 | -/* resource data */ | ||
29 | -typedef DUREX_String DUREX_data_t[229]; | ||
30 | -extern void DUREX_data_fetch(DUREX_data_t* const output); | ||
31 | -extern void DUREX_data_store(DUREX_data_t* const input); | ||
32 | - | ||
33 | -/* resource numPackets */ | ||
34 | -typedef uint8_t DUREX_numPackets_t; | ||
35 | -extern void DUREX_numPackets_fetch(DUREX_numPackets_t* const output); | ||
36 | -extern void DUREX_numPackets_store(DUREX_numPackets_t* const input); | ||
37 | - | ||
38 | -/* resource messageAvailable */ | ||
39 | -typedef DUREX_BOOLEAN DUREX_messageAvailable_t; | ||
40 | -extern void DUREX_messageAvailable_fetch(DUREX_messageAvailable_t* const output); | ||
41 | -extern void DUREX_messageAvailable_store(DUREX_messageAvailable_t* const input); | ||
42 | -extern void DUREX_messageAvailable_indicate(void); | ||
43 | - | ||
44 | -void DUREX_reset(void); | ||
45 | -void DUREX_run(void); | ||
46 | - | ||
47 | -void DUREX_accept(bool enable); | ||
48 | -void DUREX_disconnect(void); | ||
49 | -void DUREX_pairingOn(uint8_t secs, void(*handler)(void)); | ||
50 | -void DUREX_pairingOff(void(*handler)(void)); | ||
51 | - | ||
52 | -void DUREX_connectHandler(void); | ||
53 | -void DUREX_disconnectHandler(void); | ||
54 | - | ||
55 | -#ifdef __cplusplus | ||
56 | -} | ||
57 | -#endif | ||
58 | - | ||
59 | -#endif /* DUREX__H */ |
DUREX/out/DUREX.zip deleted
No preview for this file type
DUREX/out/Em_Message.h deleted
1 | -#ifndef Em_Message_H_ | ||
2 | -#define Em_Message_H_ | ||
3 | - | ||
4 | -#include "Em_Types.h" | ||
5 | - | ||
6 | -#ifdef __cplusplus | ||
7 | -extern "C" { | ||
8 | -#endif | ||
9 | - | ||
10 | -/* protocolLevel #4 */ | ||
11 | -#define Em_Message_INDSIZE 4 | ||
12 | - | ||
13 | -typedef uint8_t Em_Message_Size; | ||
14 | -typedef uint8_t Em_Message_Kind; | ||
15 | -/* protocolLevel #12 -- split 16-bit resId into <resId, chan> */ | ||
16 | -typedef int8_t Em_Message_ResId; | ||
17 | -typedef uint8_t Em_Message_Chan; | ||
18 | - | ||
19 | -#define Em_Message_NOP 0 | ||
20 | -#define Em_Message_FETCH 1 | ||
21 | -#define Em_Message_FETCH_DONE 2 | ||
22 | -#define Em_Message_STORE 3 | ||
23 | -#define Em_Message_STORE_DONE 4 | ||
24 | -#define Em_Message_INDICATOR 5 | ||
25 | -#define Em_Message_CONNECT 6 | ||
26 | -#define Em_Message_DISCONNECT 7 | ||
27 | -#define Em_Message_ECHO 8 | ||
28 | -/* protocolLevel #3 */ | ||
29 | -/* protocolLevel #6 -- rename from BROADCAST to PAIRING */ | ||
30 | -#define Em_Message_PAIRING 9 | ||
31 | -#define Em_Message_PAIRING_DONE 10 | ||
32 | -/* protocolLevel #7 */ | ||
33 | -#define Em_Message_OFFLINE 11 | ||
34 | -/* protocolLevel #8 */ | ||
35 | -#define Em_Message_ACCEPT 12 | ||
36 | - | ||
37 | -typedef struct Em_Message_Header { | ||
38 | - Em_Message_Size size; | ||
39 | - Em_Message_Kind kind; | ||
40 | - Em_Message_ResId resId; | ||
41 | - Em_Message_Chan chan; | ||
42 | -} Em_Message_Header; | ||
43 | - | ||
44 | -typedef uint16_t Em_Message_protocolLevel_t; | ||
45 | - | ||
46 | -/* protocolLevel #1 */ | ||
47 | - | ||
48 | -/* protocolLevel #10 */ | ||
49 | -/* #define Em_Message_SYS_SCHEMA_UUID -1 */ | ||
50 | - | ||
51 | -#define Em_Message_SYS_MCM_PROTOCOL_LEVEL -2 | ||
52 | -#define Em_Message_SYS_EAP_PROTOCOL_LEVEL -3 | ||
53 | -#define Em_Message_SYS_EAP_BUILD_DATE -4 | ||
54 | - | ||
55 | -/* protocolLevel #2 */ | ||
56 | -#define Em_Message_SYS_FILE_INDEX_RESET -5 | ||
57 | - | ||
58 | -/* protocolLevel #5 */ | ||
59 | -#define Em_Message_SYS_SCHEMA_HASH -6 | ||
60 | - | ||
61 | -/* protocolLevel #7 */ | ||
62 | -#define Em_Message_SYS_RESOURCE_COUNT -7 | ||
63 | - | ||
64 | -/* protocolLevel #9 */ | ||
65 | -#define Em_Message_SYS_MOBILE_RSSI -8 | ||
66 | - | ||
67 | -/* protocolLevel #11 */ | ||
68 | -#define Em_Message_SYS_MCM_DISCONNECT -9 | ||
69 | - | ||
70 | -extern void Em_Message_init(void); | ||
71 | - | ||
72 | -extern bool Em_Message_addByte(uint8_t b); | ||
73 | -extern void Em_Message_dispatch(void); | ||
74 | -extern bool Em_Message_getByte(uint8_t *bp); | ||
75 | -extern uint8_t Em_Message_lock(void); | ||
76 | -extern void Em_Message_startSend(void); | ||
77 | -extern void Em_Message_unlock(uint8_t key); | ||
78 | - | ||
79 | -#ifdef __cplusplus | ||
80 | -} | ||
81 | -#endif | ||
82 | - | ||
83 | -#endif /*Em_Message_H_*/ |