Revision 495

View differences:

branch/belin/Emb_App.tws
12 12
"E:\tp_info_2018_belin\bsp\mli.h" 
13 13
"E:\tp_info_2018_belin\bsp\periph.c" 
14 14
"E:\tp_info_2018_belin\bsp\uart0.c" 
15
"E:\tp_info_2018_belin\Emb_App\conf_noyau.cfg" 
15 16
"E:\tp_info_2018_belin\Emb_App\crt0mr.a30" 
16 17
"E:\tp_info_2018_belin\Emb_App\Debug\mr308.inc" 
17 18
"E:\tp_info_2018_belin\Emb_App\Debug\mrtable.a30" 
......
19 20
[WORKSPACE_FILE_STATES]
20 21
"E:\tp_info_2018_belin\Emb_App\Debug\mr308.inc" 175 175 765 416 0 7 
21 22
"E:\tp_info_2018_belin\Emb_App\Debug\mrtable.a30" 0 0 765 416 0 8 
23
"E:\tp_info_2018_belin\Emb_App\conf_noyau.cfg" 50 50 765 416 0 10 
22 24
"E:\tp_info_2018_belin\Emb_App\crt0mr.a30" 175 175 765 416 0 2 
23 25
"E:\tp_info_2018_belin\Emb_App\programme_principal_etud.c" 0 0 956 629 0 1 
24 26
"E:\tp_info_2018_belin\bsp\lcd.c" -8 -30 956 629 1 5 
branch/belin/Emb_App/SessionM32C_E8a_system.hsf
142 142
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_DENORMAL_MODE" "0" 
143 143
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_ROUND_MODE" "0" 
144 144
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000258" 
145
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000001" 
145
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000009" 
146 146
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_10" "0000000000000000" 
147 147
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_11" "0000000000000000" 
148 148
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_12" "0000000000000000" 
149 149
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_13" "0000000000000000" 
150 150
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_14" "0000000000000000" 
151 151
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_15" "0000000000000512" 
152
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF2CC5" 
152
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF2CE7" 
153 153
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000001004" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000844" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "000000000000102E" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000086E" 
156 156
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
157 157
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "00000000000000C8" 
158 158
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_21" "0000000000000000" 
......
171 171
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_33" "0000000000000000" 
172 172
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_34" "000000000000036A" 
173 173
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
174
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000FF0033" 
175
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "000000000040054E" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "000000000000100A" 
174
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000FF0038" 
175
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "00000000006A053F" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000001034" 
177 177
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000512" 
178 178
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_8" "0000000000000000" 
179 179
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_9" "0000000000000000" 
......
219 219
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005_SCOPE" "Current Scope," 
220 220
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006" "K, 2, 0, P, Col, Hex, MA" 
221 221
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006_SCOPE" "Global," 
222
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "7" 
222
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007" "NomPiste, 2, 0, P, Col, Hex, MA" 
223
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007_SCOPE" "Global," 
224
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "8" 
223 225
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
224 226
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
225 227
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
......
831 833
"{WK_00000001_EVENT}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 1 "0.11" 365 0 0 350 200 2065 0 "32774|32775|32777|<<separator>>|32780|<<separator>>" "0.0" 
832 834
"{WK_00000001_IO}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 0 "0.21" 259 0 0 350 200 18 0 "32817|32826|32819|32820|32821|32829" "0.0" 
833 835
"{WK_00000001_MEMORY}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 1 "0.23" 365 2 -1 350 200 2065 0 "42202|42203|42204|42233|<<separator>>|42206|42205|42230|42229|42207|<<separator>>|42208|42209|42210|49076|42228|42227|<<separator>>|42231|42232|42234|42235|<<separator>>|42211|<<separator>>|32796|32797" "0.0" 
834
"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 2 "0.34" 259 0 0 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
836
"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 2 "0.43" 259 0 0 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
835 837
"{WK_00000001_PDMR}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 3 "0.02" 259 0 0 350 200 2065 0 "47300|47301|47302|47303|47304|47305|47314|47306|47307|47308|47311|47312|47313|42211|42509|42303" "0.0" 
836 838
"{WK_00000001_REGISTERS}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59421 0 0 "1.00" 236 0 0 350 200 2065 0 "" "0.0" 
837
"{WK_00000001_WATCH}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 3 "0.44" 259 0 0 350 200 18 0 "32781|32783|<<separator>>|32771|32772|32773|<<separator>>|32786|<<separator>>|32810|32811" "0.0" 
839
"{WK_00000001_WATCH}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 3 "0.36" 259 0 0 350 200 18 0 "32781|32783|<<separator>>|32771|32772|32773|<<separator>>|32786|<<separator>>|32810|32811" "0.0" 
838 840
"{WK_00000002_WORKSPACE}" "WINDOW" 59420 0 0 "1.00" 308 0 0 350 200 18 0 "" "0.0" 
839 841
"{WK_TB00000001_STANDARD}" "TOOLBAR 0" 59419 0 2 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
840 842
"{WK_TB00000002_EDITOR}" "TOOLBAR 0" 59419 0 0 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
......
861 863
[WINDOW_Z_ORDER]
862 864
"E:\tp_info_2018_belin\bsp\lcd.c" 
863 865
"E:\tp_info_2018_belin\Emb_App\programme_principal_etud.c" 
864
"E:\tp_info_2018_belin\Disassembly" 
865 866
"E:\tp_info_2018_belin\Emb_App\crt0mr.a30" 
866
"E:\tp_info_2018_belin\bsp\periph.c" 
867
"E:\tp_info_2018_belin\Emb_App\Debug\mrtable.a30" 
868
"E:\tp_info_2018_belin\Emb_App\Debug\mr308.inc" 
869 867
"E:\tp_info_2018_belin\bsp\uart0.c" 
868
"E:\tp_info_2018_belin\Disassembly" 
869
"E:\tp_info_2018_belin\Emb_App\conf_noyau.cfg" 
870 870
"E:\tp_info_2018_belin\bsp\lcd.h" 
871 871
"E:\tp_info_2018_belin\bsp\mli.h" 
872
"E:\tp_info_2018_belin\Emb_App\Debug\mr308.inc" 
873
"E:\tp_info_2018_belin\bsp\periph.c" 
874
"E:\tp_info_2018_belin\Emb_App\Debug\mrtable.a30" 
872 875
[TARGET_NAME]
873 876
"M32C E8a SYSTEM" "" 0 
874 877
[STATUSBAR_STATEINFO_VD1]
......
915 918
[FLASH_DETAILS]
916 919
"" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
917 920
[BREAKPOINTS]
918
"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 92807344 1 "{00000000-0000-0000-C000-000000000046}" "" 
921
"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 93200560 1 "{00000000-0000-0000-C000-000000000046}" "" 
919 922
[END]
branch/belin/Emb_App/crt0mr.a30
99 99
__SYS_INITIAL:
100 100
;	LDC	#__Sys_Sp,ISP	; set initial ISP
101 101

  
102
	MOV.B	#2,0AH
102
;	MOV.B	#2,0AH
103 103
	MOV.B	#00,PMOD		; Set Processor Mode Register
104 104
	MOV.B	#0,0AH
105 105
	LDC	#0010H,FLG
branch/belin/Emb_App/programme_principal_etud.c
184 184
				comm.data.id='D';
185 185
				comm.data.rtr = 0;
186 186
				comm.data.val = 0;
187
				LED_V=0;
188
				dly_tsk(10);
189 187
		}
190 188
		else{
191 189
				//Asservissement
......
201 199
	}	
202 200
}
203 201

  
202
void BP(){
203
	while(1){
204
		if(Bp_G==1) commMoteur(0);
205
		dly_tsk(15);
206
	}
207
}
208
void LJ(){
209
	if (Distance>2000){
210
		LED_J=1;
211
		dly_tsk(1000);
212
		LED_J=!LED_J;
213
	}
214
}
215

  
204 216
void capteur(){
205 217
	CanFrame req;
206 218
	CanFrame comm;
......
212 224
			capt=periph[ADDR('C')].val;
213 225
			
214 226
			//Circuit rouge
215
		if(capt==0x6a02)commMoteur(10);	
216
		if(capt==0x4203)commMoteur(30);
227
		if(capt==0x6a02)commMoteur(5);
228
		
229
		if(capt==0x5604) commMoteur(25);
217 230

  
218 231
		if(capt==0x7610 && GEL==0){
219 232
			GEL=1;
220
			commMoteur(44);
233
			commMoteur(53);
234
			K=2;
221 235
		}
236
		dly_tsk(30);
237
	}
222 238
		
223
		//Circuit noir
239
	/*	//Circuit noir
224 240
		if(capt==0x5601){
225 241
			GEL=1;
226 242
			K=1;
......
239 255

  
240 256
		}
241 257
		if(capt==0x5603) commMoteur(20);
258
		if(capt==0x6380) commMoteur(10);
242 259
		if(capt==0x7680){
243
			commMoteur(42);
260
			commMoteur(70);
244 261
			GEL=1;
245 262
			K=1;
246 263
		}
247
		if(capt==0x4203){
264
		if(capt==0x4203 || GEL==1){
248 265
			commMoteur(10);
249 266
			GEL=0;
250 267
		}
251 268
		if(capt==0x6208)commMoteur(0);
252
		if(capt==0x5604) commMoteur(13);
253
		dly_tsk(30);
254
	}
269
		dly_tsk(30);*/
255 270
}
271
}
272

  
256 273
		
257 274
void nomPiste(){
275
	CanFrame req;
258 276
	while(1){
259
		CanFrame req;
277
		lcd_init();
260 278
		req.data.id = 'M';
261 279
		req.data.rtr = 1;
262 280
		snd_dtq(CanTx, req.msg);
263 281
		NomPiste=periph[ADDR('M')].val;
264 282
		NomPiste=NomPiste<<8;
265 283
		switch(NomPiste){
266
			case 0x0400: lcd_str("Piste Noire");
267
			break;
268
			case 0x0300: lcd_str("Piste Rouge");
269
			break;
270
			case 0x0200: lcd_str("Piste Bleue");
271
			break;
272
			case 0x0100: lcd_str("Piste Verte");
273
			break;
274
			ter_tsk();
284
			case 0x0400:
285
				lcd_str("Piste Noire"); 
286
				break;
287
			case 0x0300 :
288
				lcd_str("Piste Rouge");
289
				break;
290
			case 0x0200 :
291
				lcd_str("Piste Bleue");
292
				break;
293
			case 0x0100 :
294
				lcd_str("Piste Verte");
295
				break;
296
				dly_tsk(30);
275 297
		}
298

  
299
				
276 300
	}
301

  
277 302
}
278
			
303

  
279 304
void main()
280 305
{
281 306
	ports_mcu();
282
    lcd_init();
283 307
	periph_init();
284 308
	periph_nom("#BelinMob*");
285 309
	can_init();
286 310
    clavier_init(1);
287 311
	capture_init();
288

  
312
	
313
	sta_tsk(ID_nomPiste);
289 314
	sta_tsk(ID_periph_rx);
290 315
	sta_tsk(ID_tourelle);
291 316
	sta_tsk(ID_position);
292 317
	sta_tsk(ID_capteur);
293
	//sta_tsk(ID_nomPiste);
318
	sta_tsk(ID_BP);
294 319
	dly_tsk(500);
295 320
	commMoteur(25);
296
	K=1;
321
	K=1;
322
	
297 323
    while(1)
298
    {
299
		LED_J=1;
300
		dly_tsk(100);
301
		LED_J=0;
302
		dly_tsk(100);
324
    {

325
		LED_V=1;

326
		dly_tsk(1000);

327
		LED_V=!LED_V;
328
		dly_tsk(30);
303 329
	}
304 330
}
305 331

  
branch/belin/Emb_App/conf_noyau.cfg
2 2
//
3 3
//    kernel.cfg : building file for MR308 Ver.4.00
4 4
//
5
//    Generated by M3T-MR308 GUI Configurator at 2018/12/19 17:18:43
5
//    Generated by M3T-MR308 GUI Configurator at 2019/01/14 15:35:11
6 6
//
7 7
////////////////////////////////////////////////////////////////////////////////
8 8

  
9 9
// system definition
10 10
system{
11 11
	stack_size	= 256;
12
	priority	= 9;
12
	priority	= 10;
13 13
	system_IPL	 = 4;
14 14
	message_pri	 = 1;
15 15
	timeout	 = YES;
......
20 20

  
21 21
// max definition
22 22
maxdefine{
23
	max_task	= 7;
23
	max_task	= 9;
24 24
	max_flag	= 3;
25 25
	max_dtq	= 2;
26 26
	max_cyh	= 1;
......
93 93
	name	= ID_nomPiste;
94 94
	stack_size	= 256;
95 95
	stack_section	= stack;
96
	priority	= 10;
97
	initial_start	= OFF;
98
	exinf	= 0x0;
99
};
100
task[]{
101
	entry_address	= BP();
102
	name	= ID_BP;
103
	stack_size	= 256;
104
	stack_section	= stack;
96 105
	priority	= 9;
97 106
	initial_start	= OFF;
98 107
	exinf	= 0x0;
99 108
};
109
task[]{
110
	entry_address	= LJ();
111
	name	= ID_LJ;
112
	stack_size	= 256;
113
	stack_section	= stack;
114
	priority	= 10;
115
	initial_start	= OFF;
116
	exinf	= 0x0;
117
};
100 118

  
101 119
flag[]{
102 120
	name	= ev_bus_fin_tr;

Also available in: Unified diff