Revision 262

View differences:

branch/duvernois/Emb_App.tws
7 7
[GENERAL_DATA]
8 8
[BREAKPOINTS]
9 9
[OPEN_WORKSPACE_FILES]
10
"E:\tp_info6_2018_duvernois\tp_info6\bsp\can.c" 
11
"E:\tp_info6_2018_duvernois\tp_info6\bsp\periph.c" 
12
"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.c" 
13
"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.h" 
14 10
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\conf_noyau.cfg" 
15 11
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" 
12
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mr308.inc" 
16 13
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\sys_rom.inc" 
17 14
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\programme_principal_etud.c" 
18 15
[WORKSPACE_FILE_STATES]
19
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\sys_rom.inc" 0 0 1430 351 0 7 
20
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\conf_noyau.cfg" 150 150 1430 351 0 6 
21
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" 0 0 1596 539 0 5 
22
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\programme_principal_etud.c" -8 -30 956 523 1 4 
23
"E:\tp_info6_2018_duvernois\tp_info6\bsp\can.c" 0 0 1426 347 0 0 
24
"E:\tp_info6_2018_duvernois\tp_info6\bsp\periph.c" 50 50 1430 351 0 2 
25
"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.c" 75 75 1430 351 0 3 
26
"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.h" 25 25 1430 351 0 1 
16
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mr308.inc" 50 50 1430 351 0 4 
17
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\sys_rom.inc" 0 0 1430 351 0 2 
18
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\conf_noyau.cfg" 150 150 1430 351 0 1 
19
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" 25 25 1430 351 0 3 
20
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\programme_principal_etud.c" -8 -30 1596 539 1 0 
27 21
[LOADED_PROJECTS]
28 22
"EmbM32C87App" 
29 23
[END]
branch/duvernois/Emb_App/SessionM32C_E8a_system.hsf
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" "0000000000FF31F1" 
152
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF32FC" 
153 153
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A28" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000082C" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A46" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000084A" 
156 156
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
157 157
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "00000000000000C0" 
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" "0000000000000004" 
175
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000220000" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A28" 
174
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000006" 
175
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000120012" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A46" 
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" 
......
211 211
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Global," 
212 212
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "rottourelle, 1, 0, P, Col, Dec, MA" 
213 213
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Global," 
214
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "rotroue, 1, 0, P, Col, Hex, MN" 
214
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "rotroue, 1, 0, P, Col, Dec, MA" 
215 215
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Global," 
216 216
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "maj, 10, 0, P, Col, Hex, N" 
217 217
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Global," 
218
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "5" 
218
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "valsaut, 1, 0, P, Col, Hex, MA" 
219
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005_SCOPE" "Current Scope," 
220
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006" "consignevitesse, 1, 0, P, Col, Dec, MA" 
221
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006_SCOPE" "Global," 
222
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007" "Nump, 1, 0, P, Col, Dec, MA" 
223
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007_SCOPE" "Global," 
224
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "8" 
219 225
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
220 226
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
221 227
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
......
321 327
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" 
322 328
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\conf_noyau.cfg" 
323 329
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\sys_rom.inc" 
324
"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.c" 
325
"E:\tp_info6_2018_duvernois\tp_info6\bsp\periph.c" 
326
"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.h" 
327
"E:\tp_info6_2018_duvernois\tp_info6\bsp\can.c" 
330
"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mr308.inc" 
328 331
[TARGET_NAME]
329 332
"M32C E8a SYSTEM" "" 0 
330 333
[STATUSBAR_STATEINFO_VD1]
......
371 374
[FLASH_DETAILS]
372 375
"" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
373 376
[BREAKPOINTS]
374
"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 89963592 1 "{00000000-0000-0000-C000-000000000046}" "" 
377
"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 94360416 1 "{00000000-0000-0000-C000-000000000046}" "" 
375 378
[END]
branch/duvernois/Emb_App/programme_principal_etud.c
131 131
	int valsaut;
132 132
	int Gainroue=1;
133 133
	int consignevitesse=20;	
134
	int Nump;
134 135

  
135 136
void position ()
136 137
{	
......
195 196
	}
196 197
}
197 198

  
199

  
198 200
void saut()
201
{                
202
        //Tourelle periph[MAX_PERIPHS];
203
        
204
        CanFrame comm;
205
        CanFrame demande;
206
        UINT flag;
207
        
208
        while(1)
209
        {        
210
        demande.data.id='C'; 
211
        demande.data.rtr=1;
212
        periph[ADDR('C')].ev=0x01;
213
        snd_dtq(CanTx,demande.msg);        
214
                dly_tsk(10);        
215
        wai_flg(ev_periph,0x01,TWF_ANDW, &flag);
216
        valsaut=periph[ADDR('C')].val; 
217
        Gainroue=1;        
218
        consignevitesse=20;        
219
        
220
        if (valsaut ==0x5603)
221
        {
222
                Gainroue=0;
223
                consignevitesse=45;
224
        }
225
        if (valsaut ==0x4203)
226
        {
227
                Gainroue=1;
228
                consignevitesse=15;        
229
        }
230
        comm.data.id='V';
231
        comm.data.rtr=0;
232
        comm.data.val=consignevitesse;
233
        snd_dtq (CanTx,comm.msg);
234
        dly_tsk(100);
235
        }
236
}
237

  
238
void Piste()
199 239
{		
200
	//Tourelle periph[MAX_PERIPHS];
201
	
202

  
203
	CanFrame comm;
204 240
	CanFrame demande;
205 241

  
206 242
	UINT flag;
207 243
	
208 244
	while(1)
209 245
	{	
210
	demande.data.id='C'; 
246
	demande.data.id='M'; 
211 247
	demande.data.rtr=1;
212
	periph[ADDR('C')].ev=0x01;
248
	periph[ADDR('M')].ev=0x01;
213 249
	snd_dtq(CanTx,demande.msg);	
214 250
		dly_tsk(10);	
215 251
	wai_flg(ev_periph,0x01,TWF_ANDW, &flag);
216
	valsaut=periph[ADDR('C')].val; 
217
	Gainroue=1;	
218
	consignevitesse=20;	
219
	
220
	if (valsaut ==0x5603)
221
	{
222
		Gainroue=0;
223
		consignevitesse=45;
252
	Nump=periph[ADDR('M')].val; 
224 253
	}
225
	if (valsaut ==0x4203)
226
	{
227
		Gainroue=1;
228
		consignevitesse=15;	
229
	}
230

  
231
	comm.data.id='V';
232
	comm.data.rtr=0;
233
	comm.data.val=consignevitesse;
234
	snd_dtq (CanTx,comm.msg);
235
	dly_tsk(100);
236
	}
237 254
}
238 255

  
256

  
257

  
239 258
	
240 259
void main()
241 260
{
......
248 267
    clavier_init(1);
249 268
	capture_init();
250 269

  
251
	sta_cyc(ID_acqui);
270
	sta_cyc(ID_acqui);
271
	
252 272
	sta_tsk(ID_periph_rx);
273
	sta_tsk(ID_Piste);
253 274
	sta_tsk(ID_tourelle);
254 275
	dly_tsk(2000);
255 276
	sta_tsk(ID_position);
branch/duvernois/Emb_App/conf_noyau.cfg
88 88
	initial_start	= OFF;
89 89
	exinf	= 0x0;
90 90
};
91
task[]{
92
	entry_address	= Piste();
93
	name	= ID_Piste;
94
	stack_size	= 256;
95
	stack_section	= stack;
96
	priority	= 1;
97
	initial_start	= OFF;
98
	exinf	= 0x0;
99
};
91 100
flag[]{
92 101
	name	= ev_bus_fin_tr;
93 102
	initial_pattern	= 0x0000;

Also available in: Unified diff