Projet

Général

Profil

« Précédent | Suivant » 

Révision 503

Ajouté par jeleroy il y a presque 4 ans

Ajout fonoction decode_touche fonctionnelle

Voir les différences:

branch/leroy/sp4b1/SP4b1/SP4b1/SP4b1.hwp
[DATABASE_VERSION]
"2.8"
[PROJECT_DETAILS]
"SP4b1" "C:\WorkSpace\SP4b1\SP4b1" "C:\WorkSpace\SP4b1\SP4b1\SP4b1.hwp" "M16C/80,M32C" "Renesas M32C Standard" "Application" "M32C/80" "M32C/87(M32C/87B)"
"SP4b1" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SP4b1.hwp" "M16C/80,M32C" "Renesas M32C Standard" "Application" "M32C/80" "M32C/87(M32C/87B)"
[INFORMATION]
"No project information available"
[TOOL_CHAIN]
"Renesas M32C Standard Toolchain" "5.42.00"
[CONFIGURATIONS]
"Debug" "C:\WorkSpace\SP4b1\SP4b1\Debug"
"Debug_M32C_E8a_SYSTEM" "C:\WorkSpace\SP4b1\SP4b1\Debug_M32C_E8a_SYSTEM"
"Debug_M32C_Simulator" "C:\WorkSpace\SP4b1\SP4b1\Debug_M32C_Simulator"
"Release" "C:\WorkSpace\SP4b1\SP4b1\Release"
"Debug" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\Debug"
"Debug_M32C_E8a_SYSTEM" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\Debug_M32C_E8a_SYSTEM"
"Debug_M32C_Simulator" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\Debug_M32C_Simulator"
"Release" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\Release"
[BUILD_PHASES]
"Renesas M32C Assembler" 1
"Renesas M32C C Compiler" 1
......
"Relocatable file" "Renesas M32C Linker" "Renesas M32C Assembler"
"Relocatable file" "Renesas M32C Linker" "Renesas M32C C Compiler"
[PROJECT_FILES]
"C:\WorkSpace\SP4b1\SP4b1\SP4b1.c" "User" "C source file" 2
"C:\WorkSpace\SP4b1\SP4b1\ncrt0.a30" "User" "Assembly source file" 2
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SP4b1.c" "User" "C source file" 2
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\ncrt0.a30" "User" "Assembly source file" 2
[FOLDER]
"Assembly source file" "Assembly source file"
"C source file" "C source file"
......
[ON_DEMAND_COMPONENTS_LOADED]
[SYNC_SESSION_NAMES]
[SESSIONS]
"DefaultSession" "C:\WorkSpace\SP4b1\SP4b1\DefaultSession.hsf" 0
"SessionM32C_E8a_SYSTEM" "C:\WorkSpace\SP4b1\SP4b1\SessionM32C_E8a_SYSTEM.hsf" 0
"SessionM32C_Simulator" "C:\WorkSpace\SP4b1\SP4b1\SessionM32C_Simulator.hsf" 0
"DefaultSession" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\DefaultSession.hsf" 0
"SessionM32C_E8a_SYSTEM" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SessionM32C_E8a_SYSTEM.hsf" 0
"SessionM32C_Simulator" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SessionM32C_Simulator.hsf" 0
[GENERAL_DATA_SESSION_DefaultSession]
[GENERAL_DATA_SESSION_SessionM32C_E8a_SYSTEM]
[GENERAL_DATA_SESSION_SessionM32C_Simulator]
[OPTIONS_Debug_Renesas M32C Assembler]
"Assembly source file" "002b97571cb47d10" 2
"C:\WorkSpace\SP4b1\SP4b1\ncrt0.a30" "002b97571cb47d10" 2
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\ncrt0.a30" "002b97571cb47d10" 2
[OPTIONS_Debug_Renesas M32C C Compiler]
"C source file" "002b97571cb47d10" 1
"C:\WorkSpace\SP4b1\SP4b1\SP4b1.c" "002b97571cb47d10" 1
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SP4b1.c" "002b97571cb47d10" 1
[OPTIONS_Debug_Renesas M32C Configurator]
"Single Shot" "002b97571cb47d10" 6
[OPTIONS_Debug_Renesas M32C Librarian]
......
"[V|VERSION|1] [S|OUTPUT|OBJECTCODE] [S|OUTPUTPATH|^"$(CONFIGDIR)\$(FILELEAF).r30^"] [B|INSPECTOR|1] [S|CPU|M32C80] " 1
[EXCLUDED_FILES_Debug]
[LINKAGE_ORDER_Debug]
"C:\WorkSpace\SP4b1\SP4b1\Debug\ncrt0.r30"
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\Debug\ncrt0.r30"
[GENERAL_DATA_CONFIGURATION_Debug]
[OPTIONS_Debug_M32C_E8a_SYSTEM_Renesas M32C Assembler]
"Assembly source file" "002b97571cb47d10" 2
"C:\WorkSpace\SP4b1\SP4b1\ncrt0.a30" "002b97571cb47d10" 2
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\ncrt0.a30" "002b97571cb47d10" 2
[OPTIONS_Debug_M32C_E8a_SYSTEM_Renesas M32C C Compiler]
"C source file" "002b97571cb47d10" 1
"C:\WorkSpace\SP4b1\SP4b1\SP4b1.c" "002b97571cb47d10" 1
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SP4b1.c" "002b97571cb47d10" 1
[OPTIONS_Debug_M32C_E8a_SYSTEM_Renesas M32C Configurator]
"Single Shot" "002b97571cb47d10" 6
[OPTIONS_Debug_M32C_E8a_SYSTEM_Renesas M32C Librarian]
......
"[V|VERSION|1] [S|OUTPUT|OBJECTCODE] [S|OUTPUTPATH|^"$(CONFIGDIR)\$(FILELEAF).r30^"] [B|INSPECTOR|1] [S|CPU|M32C80] " 1
[EXCLUDED_FILES_Debug_M32C_E8a_SYSTEM]
[LINKAGE_ORDER_Debug_M32C_E8a_SYSTEM]
"C:\WorkSpace\SP4b1\SP4b1\Debug_M32C_E8a_SYSTEM\ncrt0.r30"
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\Debug_M32C_E8a_SYSTEM\ncrt0.r30"
[GENERAL_DATA_CONFIGURATION_Debug_M32C_E8a_SYSTEM]
[OPTIONS_Debug_M32C_Simulator_Renesas M32C Assembler]
"Assembly source file" "002b97571cb47d10" 2
"C:\WorkSpace\SP4b1\SP4b1\ncrt0.a30" "002b97571cb47d10" 2
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\ncrt0.a30" "002b97571cb47d10" 2
[OPTIONS_Debug_M32C_Simulator_Renesas M32C C Compiler]
"C source file" "002b97571cb47d10" 1
"C:\WorkSpace\SP4b1\SP4b1\SP4b1.c" "002b97571cb47d10" 1
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SP4b1.c" "002b97571cb47d10" 1
[OPTIONS_Debug_M32C_Simulator_Renesas M32C Configurator]
"Single Shot" "002b97571cb47d10" 6
[OPTIONS_Debug_M32C_Simulator_Renesas M32C Librarian]
......
"[V|VERSION|1] [S|OUTPUT|OBJECTCODE] [S|OUTPUTPATH|^"$(CONFIGDIR)\$(FILELEAF).r30^"] [B|INSPECTOR|1] [S|CPU|M32C80] " 1
[EXCLUDED_FILES_Debug_M32C_Simulator]
[LINKAGE_ORDER_Debug_M32C_Simulator]
"C:\WorkSpace\SP4b1\SP4b1\Debug_M32C_Simulator\ncrt0.r30"
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\Debug_M32C_Simulator\ncrt0.r30"
[GENERAL_DATA_CONFIGURATION_Debug_M32C_Simulator]
[OPTIONS_Release_Renesas M32C Assembler]
"Assembly source file" "002b97571cb47d10" 2
"C:\WorkSpace\SP4b1\SP4b1\ncrt0.a30" "002b97571cb47d10" 2
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\ncrt0.a30" "002b97571cb47d10" 2
[OPTIONS_Release_Renesas M32C C Compiler]
"C source file" "002b97571cb47d10" 1
"C:\WorkSpace\SP4b1\SP4b1\SP4b1.c" "002b97571cb47d10" 1
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SP4b1.c" "002b97571cb47d10" 1
[OPTIONS_Release_Renesas M32C Configurator]
"Single Shot" "002b97571cb47d10" 6
[OPTIONS_Release_Renesas M32C Librarian]
......
"[V|VERSION|1] [S|OUTPUT|OBJECTCODE] [S|OUTPUTPATH|^"$(CONFIGDIR)\$(FILELEAF).r30^"] [B|INSPECTOR|1] [S|CPU|M32C80] " 1
[EXCLUDED_FILES_Release]
[LINKAGE_ORDER_Release]
"C:\WorkSpace\SP4b1\SP4b1\Release\ncrt0.r30"
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\Release\ncrt0.r30"
[GENERAL_DATA_CONFIGURATION_Release]
[GENERAL_DATA_CONFIGURATION_SESSION_Debug_DefaultSession]
[SESSION_DATA_CONFIGURATION_SESSION_Debug_DefaultSession]
branch/leroy/sp4b1/SP4b1/SP4b1/DefaultSession.hsf
"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlBrowseDirectory" ""
"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlLogFileName" ""
"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlSplitterPosition" "242"
"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlViews" "0"
"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlViews" "1"
"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlWindowProperties" "17"
"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineWndInstanceKey0" "{WK_00000001_CmdLine}"
"{313F4FC1-6566-11D5-8BBE-0004E2013C71}TclTkCtrlLogFileName" ""
"{6C4D5B81-FD67-46A9-A089-EA44DCDE47FD}RAMMonitorManagerCtrlBlockInfoFileDir" ""
"{6C4D5B81-FD67-46A9-A089-EA44DCDE47FD}RAMMonitorManagerCtrlBlockInfoFileName" ""
......
0
[WINDOW_POSITION_STATE_DATA_VD1]
"Help" "TOOLBAR 0" 59419 1 5 "0.00" 0 0 0 0 0 17 0 "" "0.0"
"{WK_00000001_CmdLine}" "WINDOW" 59422 0 1 "0.33" 180 0 0 350 200 17 0 "32771|32772|32778|<<separator>>|32773|32774|<<separator>>|32820|<<separator>>|32801|32824" "0.0"
"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 0 "1.00" 180 534 287 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0"
"{WK_00000002_WORKSPACE}" "WINDOW" 59420 0 0 "1.00" 180 534 287 350 200 18 0 "" "0.0"
"{WK_TB00000001_STANDARD}" "TOOLBAR 0" 59419 0 2 "0.00" 0 0 0 0 0 18 0 "" "0.0"
......
[WINDOW_POSITION_STATE_DATA_VD3]
[WINDOW_POSITION_STATE_DATA_VD4]
[WINDOW_Z_ORDER]
"C:\WorkSpace\SP4b1\SP4b1\SP4b1.c"
"D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SP4b1.c"
[TARGET_NAME]
"" "" 1853190002
[STATUSBAR_STATEINFO_VD1]
branch/leroy/sp4b1/SP4b1/SP4b1/SP4b1.c
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; /**/
//D?claration des variables
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){
while (1){
init_keyboard();
pd10 = 0x0F; //Mode entr?e (colonnes) sortie (lignes)
p10=0; //Mise ? 0 des sorties
pu31 = 1; //Activation des r?sistance de tirage ? l'?tat haut (colonnes)
pu30 = 1;//Activation des r?sistance de tirage ? l'?tat haut (lignes)
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; //***
touche = p10; //Lecture de la valeur sur les sorties
tpo_50ms(); //anti rebond
p10 = touche;
premier_code_touche = touche & 0xF0; //Stockage du premier code de la touche
pd10 = 0xF0; ////Mode sortie (colonnes) entr?e (lignes)
p10 = 0;
pu31 = 1;
p10 = touche; //stockage du premier code la touche dans p10 pour l'appliquer sur les sorties du micro-controlleur
touche = p10;
deuxieme_code_touche = 0x0F & touche;
deuxieme_code_touche = 0x0F & touche;//Stockage du deuxi?me code de la touche
code_touche = deuxieme_code_touche+premier_code_touche;
}
decode_touche(code_touche,&valeur_touche);
code_touche = deuxieme_code_touche+premier_code_touche;//Stockage des deux code de la touche
decode_touche(code_touche, &valeur_touche);
}
}
......
void decode_touche(unsigned char code_touche,unsigned char* valeur_touche){
switch(code_touche){
case 'be' :
*valeur_touche = '1';
case (0xBE): //Code de la touche du clavier
*valeur_touche = 0x31;//code de la touche en hexadecimale
break;
case 'de' :
*valeur_touche = '2';
case (0xDE):
*valeur_touche = 0x32;
break;
case '7e' :
*valeur_touche = '3';
case (0x7E):
*valeur_touche = 0x33;
break;
case 'bd' :
*valeur_touche = '4';
case (0xBD):
*valeur_touche = 0x34;
break;
case 'dd' :
*valeur_touche = '5';
case (0xDD):
*valeur_touche = 0x35;
break;
case '7d' :
*valeur_touche = '6';
case (0x7D):
*valeur_touche = 0x36;
break;
case 'eb' :
*valeur_touche = '7';
case (0xEB):
*valeur_touche = 0x37;
break;
case 'bb' :
*valeur_touche = '8';
case (0xDB):
*valeur_touche = 0x38;
break;
case '7b' :
*valeur_touche = '9';
case (0x7B):
*valeur_touche = 0x39;
break;
case 'e7' :
*valeur_touche = '*';
case (0xE7):
*valeur_touche = 0x2A;
break;
case 'd7' :
*valeur_touche = '0';
case (0xD7):
*valeur_touche = 0x30;
break;
case '77' :
valeur_touche = '#';
case (0x77):
*valeur_touche = 0x23;
break;
}
}
}
branch/leroy/sp4b1/SP4b1/SP4b1.hws
[DATABASE_VERSION]
"11.0"
[WORKSPACE_DETAILS]
"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"
"SP4b1" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1.hws" "M16C/80,M32C" "Renesas M32C Standard"
[SHARED_WORKSPACE_CONTROL_STATUS]
"" "" ""
"" "" ""
[PROJECTS]
"SP4b1" "D:\TP_SP4_Leroy_J?r?my\sp4b1\SP4b1\SP4b1" "D:\TP_SP4_Leroy_J?r?my\sp4b1\SP4b1\SP4b1\SP4b1.hwp" 0
"SP4b1" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1" "D:\TP-SP4_LEROY_2021\sp4b1\SP4b1\SP4b1\SP4b1.hwp" 0
[INFORMATION]
"No workspace information available"
[SCRAP]

Formats disponibles : Unified diff