Additions from 19/05/2021

This commit is contained in:
Yohan Boujon 2021-03-20 19:27:26 +01:00
parent 2c0e04a7d9
commit 31876c883c
4 changed files with 107 additions and 101 deletions

View file

@ -25,7 +25,6 @@ int main(void)
saisie(tab,&taille); saisie(tab,&taille);
LCD_Command (CLEAR_DISPLAY); LCD_Command (CLEAR_DISPLAY);
printf("%s",tab); printf("%s",tab);
maj2min_convert(tab,taille);
latin2morse(tab,taille); latin2morse(tab,taille);
}; };
} }

View file

@ -103,23 +103,29 @@ void latin2morse(char *tab, int n)
int j=0; //varie la librarie int j=0; //varie la librarie
do do
{ {
if(tab[i]==morse_library[j][0]) //verifie si le caractere correspond ? la librarie switch(j)
{ {
library_checker(tab,&i,&j); //traduit dans la librairie et renvoie les deux variables pour continuer case 0:
} lcd_char(tab,&i);
else //si ce n'est pas dans la librarie maj2min_convert(tab,i);
{ default:
simple_terms(tab,&i,&j); //traduit directement les termes plus simples if(tab[i]==morse_library[j][0]) //verifie si le caractere correspond ? la librarie
{
library_checker(tab,&i,&j); //traduit dans la librairie et renvoie les deux variables pour continuer
}
else //si ce n'est pas dans la librarie
{
simple_terms(tab,&i,&j); //traduit directement les termes plus simples
};
break;
}; };
} }while(i<n); //tant qu'on arrive ? la fin du tableau
while(i<n); //tant qu'on arrive ? la fin du tableau
} }
void library_checker(char *tab,int* i,int* j) void library_checker(char *tab,int* i,int* j)
{ {
morselibrary_output(*j); //traduit en morse morselibrary_output(*j); //traduit en morse
*j=0; //on revient au d?but de la librairie *j=0; //on revient au d?but de la librairie
lcd_char(tab,i);
*i=*i+1; //on avance dans la chaine *i=*i+1; //on avance dans la chaine
if(tab[*i]!=32 && tab[*i]!='\0') //s'il n'y a pas d'espace ou de fin de mot apr?s, INTERLETTRE if(tab[*i]!=32 && tab[*i]!='\0') //s'il n'y a pas d'espace ou de fin de mot apr?s, INTERLETTRE
{ {
@ -134,7 +140,6 @@ void simple_terms(char *tab,int* i,int* j)
case 32: //si c'est un espace INTERMOT case 32: //si c'est un espace INTERMOT
envoyer_signe_morse(INTERMOT); envoyer_signe_morse(INTERMOT);
*j=0; //on revient au d?but de la librairie *j=0; //on revient au d?but de la librairie
lcd_char(tab,i);
*i=*i+1; //on avance dans la chaine *i=*i+1; //on avance dans la chaine
break; break;
case '\0': case '\0':

View file

@ -9,24 +9,24 @@
<CSub></CSub> <CSub></CSub>
<CVariant></CVariant> <CVariant></CVariant>
<CVendor>Atmel</CVendor> <CVendor>Atmel</CVendor>
<CVersion>1.2.0</CVersion> <CVersion>1.6.0</CVersion>
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath> <DefaultRepoPath>D:/Programs\Atmelstudio\7.0\Packs</DefaultRepoPath>
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" /> <DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<Description></Description> <Description></Description>
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:anyType i:type="FileInfo"> <d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.132\include</AbsolutePath> <AbsolutePath>D:/Programs\Atmelstudio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include\</AbsolutePath>
<Attribute></Attribute> <Attribute></Attribute>
<Category>include</Category> <Category>include</Category>
<Condition>C</Condition> <Condition>C</Condition>
<FileContentHash i:nil="true" /> <FileContentHash i:nil="true" />
<FileVersion></FileVersion> <FileVersion></FileVersion>
<Name>include</Name> <Name>include/</Name>
<SelectString></SelectString> <SelectString></SelectString>
<SourcePath></SourcePath> <SourcePath></SourcePath>
</d4p1:anyType> </d4p1:anyType>
<d4p1:anyType i:type="FileInfo"> <d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.132\include\avr\iom16.h</AbsolutePath> <AbsolutePath>D:/Programs\Atmelstudio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include\avr\iom16.h</AbsolutePath>
<Attribute></Attribute> <Attribute></Attribute>
<Category>header</Category> <Category>header</Category>
<Condition>C</Condition> <Condition>C</Condition>
@ -37,29 +37,29 @@
<SourcePath></SourcePath> <SourcePath></SourcePath>
</d4p1:anyType> </d4p1:anyType>
<d4p1:anyType i:type="FileInfo"> <d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.132\templates\main.c</AbsolutePath> <AbsolutePath>D:/Programs\Atmelstudio\7.0\Packs\atmel\ATmega_DFP\1.6.364\templates\main.c</AbsolutePath>
<Attribute>template</Attribute> <Attribute>template</Attribute>
<Category>source</Category> <Category>source</Category>
<Condition>C Exe</Condition> <Condition>C Exe</Condition>
<FileContentHash>ke+693fxy85p6GOdRcSK5g==</FileContentHash> <FileContentHash>KjvOcFWd++tbnsEMfVPd/w==</FileContentHash>
<FileVersion></FileVersion> <FileVersion></FileVersion>
<Name>templates/main.c</Name> <Name>templates/main.c</Name>
<SelectString>Main file (.c)</SelectString> <SelectString>Main file (.c)</SelectString>
<SourcePath></SourcePath> <SourcePath></SourcePath>
</d4p1:anyType> </d4p1:anyType>
<d4p1:anyType i:type="FileInfo"> <d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.132\templates\main.cpp</AbsolutePath> <AbsolutePath>D:/Programs\Atmelstudio\7.0\Packs\atmel\ATmega_DFP\1.6.364\templates\main.cpp</AbsolutePath>
<Attribute>template</Attribute> <Attribute>template</Attribute>
<Category>source</Category> <Category>source</Category>
<Condition>C Exe</Condition> <Condition>C Exe</Condition>
<FileContentHash>YXFphlh0CtZJU+ebktABgQ==</FileContentHash> <FileContentHash>mkKaE95TOoATsuBGv6jmxg==</FileContentHash>
<FileVersion></FileVersion> <FileVersion></FileVersion>
<Name>templates/main.cpp</Name> <Name>templates/main.cpp</Name>
<SelectString>Main file (.cpp)</SelectString> <SelectString>Main file (.cpp)</SelectString>
<SourcePath></SourcePath> <SourcePath></SourcePath>
</d4p1:anyType> </d4p1:anyType>
<d4p1:anyType i:type="FileInfo"> <d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.132\gcc\dev\atmega16</AbsolutePath> <AbsolutePath>D:/Programs\Atmelstudio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega16</AbsolutePath>
<Attribute></Attribute> <Attribute></Attribute>
<Category>libraryPrefix</Category> <Category>libraryPrefix</Category>
<Condition>GCC</Condition> <Condition>GCC</Condition>
@ -71,8 +71,8 @@
</d4p1:anyType> </d4p1:anyType>
</Files> </Files>
<PackName>ATmega_DFP</PackName> <PackName>ATmega_DFP</PackName>
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.2.132/Atmel.ATmega_DFP.pdsc</PackPath> <PackPath>D:/Programs/Atmelstudio/7.0/Packs/atmel/ATmega_DFP/1.6.364/Atmel.ATmega_DFP.pdsc</PackPath>
<PackVersion>1.2.132</PackVersion> <PackVersion>1.6.364</PackVersion>
<PresentInProject>true</PresentInProject> <PresentInProject>true</PresentInProject>
<ReferenceConditionId>ATmega16</ReferenceConditionId> <ReferenceConditionId>ATmega16</ReferenceConditionId>
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">

View file

@ -27,16 +27,16 @@
<BootSegment>2</BootSegment> <BootSegment>2</BootSegment>
<eraseonlaunchrule>0</eraseonlaunchrule> <eraseonlaunchrule>0</eraseonlaunchrule>
<AsfFrameworkConfig> <AsfFrameworkConfig>
<framework-data xmlns=""> <framework-data>
<options /> <options />
<configurations /> <configurations />
<files /> <files />
<documentation help="" /> <documentation help="" />
<offline-documentation help="" /> <offline-documentation help="" />
<dependencies> <dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.34.1" /> <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.42.0" />
</dependencies> </dependencies>
</framework-data> </framework-data>
</AsfFrameworkConfig> </AsfFrameworkConfig>
<avrtool>com.atmel.avrdbg.tool.stk500</avrtool> <avrtool>com.atmel.avrdbg.tool.stk500</avrtool>
<avrtoolserialnumber /> <avrtoolserialnumber />
@ -67,83 +67,85 @@
</ToolNumber> </ToolNumber>
<ToolName xmlns="">Simulator</ToolName> <ToolName xmlns="">Simulator</ToolName>
</com_atmel_avrdbg_tool_simulator> </com_atmel_avrdbg_tool_simulator>
<ResetRule>0</ResetRule>
<EraseKey />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings> <ToolchainSettings>
<AvrGcc> <AvrGcc>
<avrgcc.common.Device>-mmcu=atmega16 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.2.132\gcc\dev\atmega16"</avrgcc.common.Device> <avrgcc.common.Device>-mmcu=atmega16 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega16"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex> <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss> <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep> <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec> <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures> <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned> <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned> <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols> <avrgcc.compiler.symbols.DefSymbols>
<ListValues> <ListValues>
<Value>NDEBUG</Value> <Value>NDEBUG</Value>
</ListValues> </ListValues>
</avrgcc.compiler.symbols.DefSymbols> </avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths> <avrgcc.compiler.directories.IncludePaths>
<ListValues> <ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.2.132\include</Value> <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues> </ListValues>
</avrgcc.compiler.directories.IncludePaths> </avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level> <avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers> <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum> <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings> <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries> <avrgcc.linker.libraries.Libraries>
<ListValues> <ListValues>
<Value>libm</Value> <Value>libm</Value>
</ListValues> </ListValues>
</avrgcc.linker.libraries.Libraries> </avrgcc.linker.libraries.Libraries>
<avrgcc.assembler.general.IncludePaths> <avrgcc.assembler.general.IncludePaths>
<ListValues> <ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.2.132\include</Value> <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues> </ListValues>
</avrgcc.assembler.general.IncludePaths> </avrgcc.assembler.general.IncludePaths>
</AvrGcc> </AvrGcc>
</ToolchainSettings> </ToolchainSettings>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings> <ToolchainSettings>
<AvrGcc> <AvrGcc>
<avrgcc.common.Device>-mmcu=atmega16 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.2.132\gcc\dev\atmega16"</avrgcc.common.Device> <avrgcc.common.Device>-mmcu=atmega16 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega16"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex> <avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss> <avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep> <avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec> <avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures> <avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned> <avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned> <avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols> <avrgcc.compiler.symbols.DefSymbols>
<ListValues> <ListValues>
<Value>DEBUG</Value> <Value>DEBUG</Value>
</ListValues> </ListValues>
</avrgcc.compiler.symbols.DefSymbols> </avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths> <avrgcc.compiler.directories.IncludePaths>
<ListValues> <ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.2.132\include</Value> <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues> </ListValues>
</avrgcc.compiler.directories.IncludePaths> </avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level> <avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers> <avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum> <avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel> <avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings> <avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries> <avrgcc.linker.libraries.Libraries>
<ListValues> <ListValues>
<Value>libm</Value> <Value>libm</Value>
</ListValues> </ListValues>
</avrgcc.linker.libraries.Libraries> </avrgcc.linker.libraries.Libraries>
<avrgcc.assembler.general.IncludePaths> <avrgcc.assembler.general.IncludePaths>
<ListValues> <ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.2.132\include</Value> <Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues> </ListValues>
</avrgcc.assembler.general.IncludePaths> </avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel> <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc> </AvrGcc>
</ToolchainSettings> </ToolchainSettings>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>