Revision 536

View differences:

branch/mbaye/Emb_App.tws
11 11
"E:\tp_info6_2018_mbaye\tp_info6\bsp\uart0.c" 
12 12
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\conf_noyau.cfg" 
13 13
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" 
14
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\Debug\mr308.inc" 
14 15
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 
15 16
[WORKSPACE_FILE_STATES]
17
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\Debug\mr308.inc" 150 150 1430 351 0 6 
16 18
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\conf_noyau.cfg" 0 474 160 38 0 1 
17 19
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" -8 -30 1596 539 1 3 
18 20
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 0 0 1596 539 0 2 
branch/mbaye/Emb_App/SessionM32C_E8a_system.ini
25 25
[Target]
26 26
M32C E8a SYSTEM=Renesas Communications
27 27
[USER_DATA]
28
RESET=ff0044
28
RESET=ff008a
branch/mbaye/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" "0000000000FF0570" 
152
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF05B0" 
153 153
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000001852" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000882" 
154
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "000000000000174A" 
155
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000884" 
156 156
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000001" 
157
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000044" 
157
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000004044" 
158 158
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_21" "0000000000000000" 
159 159
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_22" "0000000000000000" 
160 160
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_23" "0000000000000000" 
......
173 173
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
174 174
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "000000000000000B" 
175 175
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "000000000000187E" 
176
"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000001780" 
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" 
......
217 217
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Current Scope," 
218 218
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "feu, 1, 0, P, Col, Hex, MA" 
219 219
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005_SCOPE" "Current Scope," 
220
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "6" 
220
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006" "tour, 10, 0, P, Col, Hex, N" 
221
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006_SCOPE" "Current Scope," 
222
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "7" 
221 223
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
222 224
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
223 225
"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
......
321 323
[WINDOW_Z_ORDER]
322 324
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" 
323 325
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 
326
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\Debug\mr308.inc" 
324 327
"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\conf_noyau.cfg" 
325 328
"E:\tp_info6_2018_mbaye\tp_info6\bsp\uart0.c" 
326 329
"E:\tp_info6_2018_mbaye\tp_info6\bsp\can.c" 
......
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 90910464 1 "{00000000-0000-0000-C000-000000000046}" "" 
377
"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 90242312 1 "{00000000-0000-0000-C000-000000000046}" "" 
375 378
[END]
branch/mbaye/Emb_App/programme_principal_etud.c
129 129
int info_piste;
130 130
int numero_p;
131 131
int feu;
132
//int tour=1;
132
int tour=1;
133 133
int consigne =450;
134 134

  
135 135
void asserv_T()
......
262 262
	{
263 263
	  CanFrame commv;
264 264
	  commv.data.id='V'; commv.data.rtr=0; 
265
      dly_tsk(3000);
266
	  //if(capt==0x5602) tour=tour+1;
267 265
	  if(Bp_G==1)
268 266
	  {
269 267
		  commv.data.val=0;
270 268
	      snd_dtq (CanTx,commv.msg);
269
		  LED_R=!LED_R;
271 270
	  }
272
	  /*if(tour==4)
271
	  if(Bp_M==1)
273 272
	  {
273
		  commv.data.val=ad00+ad01;
274
	      snd_dtq (CanTx,commv.msg);
275
		  LED_R=!LED_R;
276
	  }
277
	  if(tour==4)
278
	  {
274 279
		  commv.data.val=0;
275 280
	      snd_dtq (CanTx,commv.msg);
276
	  }*/
281
	  }
282
      dly_tsk(3000);
283
	  
284

  
277 285
	  switch (numero_p)
278 286
	  {
279 287
	    //else if(numero_p==0x0001)
......
320 328
		  }
321 329
		  else if(capt==0x4a01)
322 330
		  {
323
	        commv.data.val=10;
331
	        commv.data.val=22;
324 332
	        snd_dtq (CanTx,commv.msg);
325 333
		  }
326 334
			
......
329 337
	        commv.data.val=20;
330 338
	        snd_dtq (CanTx,commv.msg);
331 339
		  }
332
		  
340
		  else if(capt==0x5604)
341
		  {
342
	        commv.data.val=30;
343
	        snd_dtq (CanTx,commv.msg);
344
		  }
333 345
		  else
334 346
		  {
335
		    commv.data.val=15;
347
		    commv.data.val=20;
336 348
	        snd_dtq (CanTx,commv.msg);	
337 349
		  }
338 350
		  break;
......
391 403
	   snd_dtq (CanTx,req.msg);
392 404
	   wai_flg(ev_periph, 0x01, TWF_ANDW, &flag);
393 405
       capt = periph[ADDR('C')].val;
394
	   dly_tsk(50);
406
	   dly_tsk(30);
407
	   if(capt==0x5602)
408
	   {
409
		    tour=tour+1;
410
			dly_tsk(30);
411
	   }
395 412
	}
396 413
}
397 414
void mode_course()
......
431 448
        return puiss;        
432 449
}
433 450
unsigned int decode_int(char *chaine){
434
 unsigned int  nombre=0;
435
 int entier[10]={0};
436
 int i=0,j = 0, n = 0;
437
 if(chaine[i] != '#') return -1;
438
 i=1;
451
unsigned int  nombre=0;
452
int entier[10]={0};
453
int i=0,j = 0, n = 0;
454
if(chaine[i] != '#') return -1;
455
i=1;
439 456
  while(chaine[i] != '*')
440 457
    {                
441
                if('0'>chaine[i] && chaine[i]>'9') return -1;
442
                entier[i-1] = chaine[i] - '0';
443
                i++;
444
        }
445
        for(j=0;j<i-1;j++)
446
        {
447
         nombre = nombre + entier[j]*Puiss10(i-2-j);        
448
        }
449
        return nombre;
450
   
451
 /*if(chaine[i]='#'){
452
  
453
  i++;
454
  c=chaine[i];
455
  while(c!='*'){ 
456
   if(c<=57 && c>=48){
457
    nombre=(nombre*10)+(c-48);     
458
   }
459
   i++;
460
   return nombre;
461
  }  
462
 }
463
 else{
464
  return -1;
465
 }*/
458
        if('0'>chaine[i] && chaine[i]>'9') return -1;
459
        entier[i-1] = chaine[i] - '0';
460
        i++;
461
    }
462
   for(j=0;j<i-1;j++)
463
    {
464
        nombre = nombre + entier[j]*Puiss10(i-2-j);        
465
    }
466
    return nombre;
466 467
}
467 468
void clavier() 
468 469
{
......
471 472
 int index = 1;
472 473
 while(1) 
473 474
 {
474
          vrcv_dtq(QdmTouche, &code_touche);
475
            lcd_putc(code_touche);
476
                while(code_touche != '*')
477
                {                
478
                   if(code_touche == '#')
479
                    {
480
                      sequence[0] = code_touche; 
481
                    } 
482
                    else
483
                    {
484
                     sequence[index] = code_touche;
485
                        index++;
486
                     }
487
                     vrcv_dtq(QdmTouche, &code_touche);
488
                     lcd_putc(code_touche);
489
                 }
490
        sequence[index] = '*';
491
        //consigne = decode_int(sequence);
492
        index=1;
475
     vrcv_dtq(QdmTouche, &code_touche);
476
     lcd_putc(code_touche);
477
     while(code_touche != '*')
478
     {                
479
       if(code_touche == '#')
480
         {
481
            sequence[0] = code_touche; 
482
         } 
483
       else
484
         {
485
           sequence[index] = code_touche;
486
           index++;
487
         }
488
       vrcv_dtq(QdmTouche, &code_touche);
489
       lcd_putc(code_touche);
490
      }
491
	 //lcd_com(0xC0);
492
      sequence[index] = '*';
493
      consigne = decode_int(sequence);
494
      index=1;
495
		
496
		
493 497
 }
494 498
 dly_tsk(60);
495 499
		
......
518 522
	sta_tsk(ID_mode_course);
519 523
	sta_tsk(ID_clavier);
520 524
	
521
	switch (numero_p){
525
	
526
	
527
	
528

  
529
    while(1)
530
    {
531
		
532
	  lcd_com(0x80);
533
		switch (numero_p){
522 534
			case 0x0001:
523 535
			lcd_str("Piste Verte");
524 536
			break;
......
532 544
			lcd_str("Piste Noire");
533 545
			break;
534 546
		}
535
		 dly_tsk(50);
536

  
537
    while(1)
538
    {
539
	   dly_tsk(1000); 
547
		 dly_tsk(50);
548
		 lcd_com(0xC0);
549
		 switch (capt){
550
			case 0x5601:
551
			lcd_str("Capteur vert");
552
			break;
553
			case 0x4a01:
554
			lcd_str("Capteur Jaune");
555
			break;
556
			case 0x5202:
557
			lcd_str("Capteur Rouge");
558
			break;
559
			case 0x4203:
560
			lcd_str("Capteur Bleu");
561
			break;
562
			case 0x4304:
563
			lcd_str("Capteur Cyan");
564
			break;
565
			dly_tsk(20);
566
		 }
567
	  
540 568
    }
541 569
		
542 570
}
branch/mbaye/Emb_App/conf_noyau.cfg
20 20

  
21 21
// max definition
22 22
maxdefine{
23
	max_task	= 10;
23
	max_task	= 11;
24 24
	max_flag	= 3;
25 25
	max_dtq	= 2;
26 26
	max_cyh	= 1;
......
70 70
	initial_start	= ON;
71 71
	exinf	= 0x0;
72 72
};
73

  
73 74
task[]{
74 75
	entry_address	= info_capt();
75 76
	name	= ID_info_capt;
branch/mbaye/Emb_App/EmbM32C87App.tps
18 18
"SessionM32C_E8a_system" 
19 19
[GENERAL_DATA_PROJECT]
20 20
[GENERAL_DATA_CONFIGURATION_Debug]
21
"PROJECT_FILES_MODIFIED_DATA_TAG" "FALSE" 
21
"PROJECT_FILES_MODIFIED_DATA_TAG" "TRUE" 
22 22
[SESSIONS_Debug]
23 23
"DefaultSession" 
24 24
"SessionM32C_E8a_system" 

Also available in: Unified diff