Projet

Général

Profil

« Précédent | Suivant » 

Révision 322

Ajouté par jeleroy il y a presque 4 ans

Fin TP4 (sauf decode_code)

Voir les différences:

branch/leroy/sp4b1/SP4b1/SP4b1/SP4b1.c
/* This file is generated by Renesas Project Generator (Ver.4.18). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/***********************************************************************/
#include "sfr32c87.h"
void main(void)
{
void init_keyboard(void);
void tpo_50ms(void);
void decode_touche(unsigned char code_touche,unsigned char* valeur_touche);
unsigned char touche = 0; /**/
unsigned char premier_code_touche = 0; /**/
unsigned char deuxieme_code_touche = 0; /**/
unsigned char code_touche = 0;
unsigned char valeur_touche;
int i;
void main(void){
init_keyboard();
while(1){
pd10 = 0x0F;
p10=0;
pu31 = 1;
pu30 = 1;
/*if ((p10 & 0xf0)!= 0xf0)*/{
touche = p10;
tpo_50ms();
premier_code_touche = touche & 0xF0; /****/
pd10 = 0xF0;
// p10 = 0; //**
pu31 = 1; //***
p10 = touche;
touche = p10;
deuxieme_code_touche = 0x0F & touche;
code_touche = deuxieme_code_touche+premier_code_touche;
}
decode_touche(code_touche,&valeur_touche);
}
}
void init_keyboard(void){
pd10 = 0x0F;
p10=0;
pu31 = 1; //**
}
void tpo_50ms(void){
tcspr = 0x8A;ta0mr = 0x82;
ta0 = 50000;
ta0s = 1;
ta0os = 1;
ta0ic = 0x00;
while(ir_ta0ic != 1);
ta0s = 0;
}
void decode_touche(unsigned char code_touche,unsigned char* valeur_touche){
}
switch(code_touche){
case 'be' :
*valeur_touche = '1';
break;
case 'de' :
*valeur_touche = '2';
break;
case '7e' :
*valeur_touche = '3';
break;
case 'bd' :
*valeur_touche = '4';
break;
case 'dd' :
*valeur_touche = '5';
break;
case '7d' :
*valeur_touche = '6';
break;
case 'eb' :
*valeur_touche = '7';
break;
case 'bb' :
*valeur_touche = '8';
break;
case '7b' :
*valeur_touche = '9';
break;
case 'e7' :
*valeur_touche = '*';
break;
case 'd7' :
*valeur_touche = '0';
break;
case '77' :
valeur_touche = '#';
break;
}
}
branch/leroy/sp4b1/SP4b1/SP4b1.hws
[DATABASE_VERSION]
"11.0"
[WORKSPACE_DETAILS]
"SP4b1" "C:\WorkSpace\SP4b1" "C:\WorkSpace\SP4b1\SP4b1.hws" "M16C/80,M32C" "Renesas M32C Standard"
"SP4b1" "D:\TP_SP4_Leroy_J?r?my\sp4b1\SP4b1" "D:\TP_SP4_Leroy_J?r?my\sp4b1\SP4b1\SP4b1.hws" "M16C/80,M32C" "Renesas M32C Standard"
[SHARED_WORKSPACE_CONTROL_STATUS]
"" "" ""
"" "" ""
[PROJECTS]
"SP4b1" "C:\WorkSpace\SP4b1\SP4b1" "C:\WorkSpace\SP4b1\SP4b1\SP4b1.hwp" 0
"SP4b1" "D:\TP_SP4_Leroy_J?r?my\sp4b1\SP4b1\SP4b1" "D:\TP_SP4_Leroy_J?r?my\sp4b1\SP4b1\SP4b1\SP4b1.hwp" 0
[INFORMATION]
"No workspace information available"
[SCRAP]
......
[MAKEFILE_BUILD_INFO]
"$(WORKSPDIR)\make\$(PROJECTNAME)_$(CONFIGNAME).mak" "" "$(WORKSPDIR)\make" 0 0 0
[VD_CONFIGURATION_OPTIONS]
"ACTIVE_DESKTOP" "0"
[VD_CONFIGURATIONS]
"0" "Default1" "1"
"1" "Default2" "1"
"2" "Default3" "1"
"3" "Default4" "1"
[OPTIONS_DEBUG_TAB]
0 0 0 0 0
[VCS]

Formats disponibles : Unified diff