瀏覽代碼

Modification du Soft

CLUZE Remy -EXT 6 年之前
父節點
當前提交
4b77042582

二進制
Doc/AideSoft.xlsx


+ 39 - 5
Soft/STM32/Controle/.cproject

@@ -37,7 +37,6 @@
 								<option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.1092350335" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.none" valueType="enumerated"/>
 								<option id="gnu.c.compiler.option.debugging.level.1430076330" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
 								<option id="gnu.c.compiler.option.include.paths.1619885247" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
-									<listOptionValue builtIn="false" value="/home/remy/SynologyDrive/Transféré/DriverSTM_RC/Include"/>
 									<listOptionValue builtIn="false" value="&quot;C:\Users\e_rcluze\Documents\Autres\projet\DriverSTM_RC\Include&quot;"/>
 									<listOptionValue builtIn="false" value="../Inc"/>
 									<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc"/>
@@ -82,10 +81,10 @@
 								<inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.715107063" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s"/>
 							</tool>
 							<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.2018387372" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
-								<option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.87965815" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" value="../STM32F401RCTx_FLASH.ld" valueType="string"/>
-								<option id="gnu.c.link.option.libs.1373616362" name="Libraries (-l)" superClass="gnu.c.link.option.libs"/>
-								<option id="gnu.c.link.option.paths.70222859" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/>
-								<option id="gnu.c.link.option.ldflags.715367124" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
+								<option id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script.87965815" name="Linker Script (-T)" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.script" useByScannerDiscovery="false" value="../STM32F401RCTx_FLASH.ld" valueType="string"/>
+								<option id="gnu.c.link.option.libs.1373616362" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false"/>
+								<option id="gnu.c.link.option.paths.70222859" name="Library search path (-L)" superClass="gnu.c.link.option.paths" useByScannerDiscovery="false"/>
+								<option id="gnu.c.link.option.ldflags.715367124" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="-specs=nosys.specs -specs=nano.specs" valueType="string"/>
 								<option id="gnu.c.link.option.other.2046912267" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" useByScannerDiscovery="false"/>
 								<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.996137722" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
 									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
@@ -111,6 +110,41 @@
 							</tool>
 						</toolChain>
 					</folderInfo>
+					<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.745205628.1072813479" name="/" resourcePath="DriverSTM_RC">
+						<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.2094051756" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug" unusedChildren="">
+							<option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1134037625.1129409001" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix.1134037625"/>
+							<option id="fr.ac6.managedbuild.option.gnu.cross.mcu.1786405401.1139776047" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu.1786405401"/>
+							<option id="fr.ac6.managedbuild.option.gnu.cross.board.375536696.1055122571" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board.375536696"/>
+							<option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614.174477813" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core.1083960614"/>
+							<option id="fr.ac6.managedbuild.option.gnu.cross.instructionSet.1278913957.1924417483" name="Instruction Set" superClass="fr.ac6.managedbuild.option.gnu.cross.instructionSet.1278913957"/>
+							<option id="fr.ac6.managedbuild.option.gnu.cross.fpu.724348567.321365980" name="Floating point hardware" superClass="fr.ac6.managedbuild.option.gnu.cross.fpu.724348567"/>
+							<option id="fr.ac6.managedbuild.option.gnu.cross.floatabi.406296507.212439019" name="Floating-point ABI" superClass="fr.ac6.managedbuild.option.gnu.cross.floatabi.406296507"/>
+							<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1955112254" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.586945225">
+								<option id="gnu.c.compiler.option.include.paths.598672550" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;C:\Users\e_rcluze\Documents\Autres\projet\DriverSTM_RC\Include&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;C:\Users\e_rcluze\Documents\Autres\projet\DriverSTM_RC\Include&quot;"/>
+									<listOptionValue builtIn="false" value="../Inc"/>
+									<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc"/>
+									<listOptionValue builtIn="false" value="../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy"/>
+									<listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/include"/>
+									<listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS"/>
+									<listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F"/>
+									<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F4xx/Include"/>
+									<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
+								</option>
+								<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.646474139" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>
+								<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.1544990721" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>
+							</tool>
+							<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.740575990" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.2045706743"/>
+							<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.1739308829" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker.2018387372"/>
+							<tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.1685878982" name="MCU G++ Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.75010142"/>
+							<tool id="fr.ac6.managedbuild.tool.gnu.archiver.97952842" name="MCU GCC Archiver" superClass="fr.ac6.managedbuild.tool.gnu.archiver.1110335707"/>
+							<tool id="fr.ac6.managedbuild.tool.gnu.cross.assembler.856437560" name="MCU GCC Assembler" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.1644446420">
+								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.101649444" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+								<inputType id="fr.ac6.managedbuild.tool.gnu.cross.assembler.input.1220923294" superClass="fr.ac6.managedbuild.tool.gnu.cross.assembler.input"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
 					<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.745205628.1483617142" name="/" resourcePath="Inc">
 						<toolChain id="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.1013828548" name="Ac6 STM32 MCU GCC" superClass="fr.ac6.managedbuild.toolchain.gnu.cross.exe.debug" unusedChildren="">
 							<option id="fr.ac6.managedbuild.option.gnu.cross.prefix.1134037625.454030241" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix.1134037625"/>

+ 1 - 6
Soft/STM32/Controle/Inc/Tab.h

@@ -23,14 +23,9 @@ typedef struct {
 
 }Sortie;
 
-Heure HeureDem[10];
-Heure HeureExt[10];
-
 Sortie tabSortie[10];
 
-void initHeure();
-
-void initSortie();
+void initTab();
 
 void WriteTab(Sortie *t);
 

+ 1 - 2
Soft/STM32/Controle/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c

@@ -903,7 +903,7 @@ osStatus osSemaphoreDelete (osSemaphoreId semaphore_id)
 
 #if (defined (osFeature_Pool)  &&  (osFeature_Pool != 0)) 
 
-//TODO
+
 //This is a primitive and inefficient wrapper around the existing FreeRTOS memory management.
 //A better implementation will have to modify heap_x.c!
 
@@ -1239,7 +1239,6 @@ osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id)
   /* Create a mail pool */
   (*(queue_def->cb))->pool = osPoolCreate(&pool_def);
   if ((*(queue_def->cb))->pool == NULL) {
-    //TODO: Delete queue. How to do it in FreeRTOS?
     vPortFree(*(queue_def->cb));
     return NULL;
   }

+ 9 - 6
Soft/STM32/Controle/Src/Comunication.c

@@ -43,23 +43,26 @@ void Com_WriteTabHeure(uint8_t* mes){
 		tabSortie[i].Demmarage=h;
 	else
 		tabSortie[i].Extinxtion=h;
-	//HAL_SPI_Transmit(&hspi1,) retour non fait
+	uint16_t add = (mes[0]*2)-2; //On ecrit la valeurs que l'on viens de modifier dans l'eeprom. Adresse dans l'eeprom = mes[0]*2-2 voir Tableau excel address
+	writeData(add,&mes[1],2);
 }
 
 void Com_WriteTabVal(uint8_t* mes){
 	int i = mes[0] & MASKID;
 	if ((mes[0]&MASKTYPE)>>4)
-			tabSortie[i].PuissanceMax=mes[1];
-		else
-			tabSortie[i].Pente=mes[1];
+		tabSortie[i].PuissanceMax=mes[1];
+	else
+		tabSortie[i].Pente=mes[1];
+	uint16_t add = (mes[0]*2)+22;//On ecrit la valeurs que l'on viens de modifier dans l'eeprom. Adresse dans l'eeprom = mes[0]*2+22 voir Tableau excel address
+	writeData(add,&mes[1],1);
 }
 
 void Com_ReadVent(uint8_t* mes){
-	//TODO
+	//TODO Rajout plus tard si ventilation sur la rampe
 }
 
 void Com_WriteVent(uint8_t* mes){
-	//TODO
+	//TODO Rajout plus tard si ventilation sur la rampe
 }
 
 void Com_ERROR(uint8_t* mes){

+ 15 - 61
Soft/STM32/Controle/Src/Tab.c

@@ -7,69 +7,23 @@
 
 #include "Tab.h"
 #include "RTC.h"
-
-void initHeure(){
-	HeureDem[0].heure = 9;	HeureDem[0].minute = 0;
-	HeureDem[1].heure = 9; 	HeureDem[1].minute = 0;
-	HeureDem[2].heure = 9; 	HeureDem[2].minute = 0;
-	HeureDem[3].heure = 9; 	HeureDem[3].minute = 0;
-	HeureDem[4].heure = 9; 	HeureDem[4].minute = 0;
-	HeureDem[5].heure = 9; 	HeureDem[5].minute = 0;
-	HeureDem[6].heure = 9; 	HeureDem[6].minute = 0;
-	HeureDem[7].heure = 9; 	HeureDem[7].minute = 0;
-	HeureDem[8].heure = 9; 	HeureDem[8].minute = 0;
-	HeureDem[9].heure = 9; 	HeureDem[9].minute = 0;
-
-
-	HeureExt[0].heure = 22;		HeureExt[0].minute = 0;
-	HeureExt[1].heure = 22; 	HeureExt[1].minute = 0;
-	HeureExt[2].heure = 22; 	HeureExt[2].minute = 0;
-	HeureExt[3].heure = 22; 	HeureExt[3].minute = 0;
-	HeureExt[4].heure = 22; 	HeureExt[4].minute = 0;
-	HeureExt[5].heure = 22; 	HeureExt[5].minute = 0;
-	HeureExt[6].heure = 22; 	HeureExt[6].minute = 0;
-	HeureExt[7].heure = 22; 	HeureExt[7].minute = 0;
-	HeureExt[8].heure = 22; 	HeureExt[8].minute = 0;
-	HeureExt[9].heure = 22;		HeureExt[9].minute = 0;
-
-}
-
-void initSortie(){
-	for (int i =0 ; i<10;i++){
-		tabSortie[i].Demmarage=HeureDem[i];
-		tabSortie[i].Extinxtion=HeureExt[i];
+#include "Eeprom.h"
+
+void initTab(){
+	uint8_t val[24*2];
+	readData(0x0000,val,24*2);
+	Heure Dem, Ext;
+	for (int i =0 ; i<6;i++){
+		tabSortie[i].PuissanceMax=val[(i*2)-2];
+		tabSortie[i].Pente=val[(i*2)+0x0C];
+		Dem.heure= val[(i*2)+0x18];
+		Dem.minute = val[(i*2)+0x19];
+		tabSortie[i].Demmarage= Dem;
+		Ext.heure = val[(i*2)+0x24];
+		Ext.minute = val[(i*2)+0x25];
+		tabSortie[i].Extinxtion= Ext;
 		tabSortie[i].Fonctionement=0;
 	}
-	//S1
-	tabSortie[0].Pente=60;
-	tabSortie[0].PuissanceMax=60;
-
-	tabSortie[1].Pente=60;
-	tabSortie[1].PuissanceMax=60;
-
-	tabSortie[2].Pente=60;
-	tabSortie[2].PuissanceMax=100;
-
-	tabSortie[3].Pente=60;
-	tabSortie[3].PuissanceMax=20;
-
-	tabSortie[4].Pente=60;
-	tabSortie[4].PuissanceMax=10;
-
-	tabSortie[5].Pente=60;
-	tabSortie[5].PuissanceMax=40;
-
-	tabSortie[6].Pente=60;
-	tabSortie[6].PuissanceMax=0;
-
-	tabSortie[7].Pente=60;
-	tabSortie[7].PuissanceMax=0;
-
-	tabSortie[8].Pente=60;
-	tabSortie[8].PuissanceMax=0;
-
-	tabSortie[9].Pente=60;
-	tabSortie[9].PuissanceMax=0;
 }
 
 void WriteTab(Sortie *t){

+ 7 - 8
Soft/STM32/Controle/Src/freertos.c

@@ -57,10 +57,10 @@
 /* Private includes ----------------------------------------------------------*/
 /* USER CODE BEGIN Includes */     
 #include <stdint.h>
-//#include "PWM.h"
-//#include "RTC.h"
-//#include "Tab.h"
-//#include "Heure.h"
+#include "PWM.h"
+#include "RTC.h"
+#include "Tab.h"
+#include "Heure.h"
 /* USER CODE END Includes */
 
 /* Private typedef -----------------------------------------------------------*/
@@ -171,14 +171,13 @@ void TimerTask(void const * argument)
 	 * Il suffit ensuite de venir ecrire un bit de configuration pour que les registres de date ce mette a jour avec la date actuels.
 	 */
 void init(){
-	HAL_Delay(1);
-	/*initHeure(); //Initialisation du tableau des heures
-	initSortie(); //Initialisation du tableau des sortie.
-	//Date ancienDate;
+	initTab(); //Initialisation du tableau des heures
+	Date ancienDate;
 	Date newDate;
 	readDate(&ancienDate);//Lecture de l'heure fige
 	redemareRTC();//Redemarage des Mise a jours des registres RTC
 	readDate(&newDate);// Lecture de la nouvelle heure*/
+	//TODO Faire un programme pour une reprise en douceur
 }
 /* USER CODE END Application */
 

+ 3 - 1
Soft/STM32/Controle/Src/main.c

@@ -127,7 +127,8 @@ int main(void)
   MX_ADC1_Init();
   MX_TIM2_Init();
   /* USER CODE BEGIN 2 */
-
+  initEprom(&hi2c2,WC_GPIO_Port,WC_Pin);
+  initRTC(&hi2c2);
   /* USER CODE END 2 */
 
   /* Call init function for freertos objects (in freertos.c) */
@@ -141,6 +142,7 @@ int main(void)
   /* Infinite loop */
   /* USER CODE BEGIN WHILE */
 
+
 	while (1) {
     /* USER CODE END WHILE */