change format of rtc
This commit is contained in:
parent
b429bebe94
commit
f8490e32a5
@ -34,7 +34,7 @@
|
|||||||
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.200059038" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
|
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.200059038" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
|
||||||
<option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.980386303" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.size" valueType="enumerated" />
|
<option defaultValue="gnu.c.optimization.level.none" id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.980386303" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.size" valueType="enumerated" />
|
||||||
<option id="gnu.c.compiler.option.debugging.level.1427005300" 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.debugging.level.1427005300" 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.2008187284" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"><listOptionValue builtIn="false" value="../Inc" /><listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc" /><listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy" /><listOptionValue builtIn="false" value="../Drivers/CMSIS/Include" /><listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include" /></option>
|
<option id="gnu.c.compiler.option.include.paths.2008187284" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"><listOptionValue builtIn="false" value="../Inc" /><listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc" /><listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy" /><listOptionValue builtIn="false" value="../Drivers/CMSIS/Include" /><listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include" /><listOptionValue builtIn="false" value="../Inc" /></option>
|
||||||
<option id="gnu.c.compiler.option.preprocessor.def.symbols.281399675" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"><listOptionValue builtIn="false" value="__weak="__attribute__((weak))"" /><listOptionValue builtIn="false" value="__packed="__attribute__((__packed__))"" /><listOptionValue builtIn="false" value="USE_HAL_DRIVER" /><listOptionValue builtIn="false" value="STM32F103xE" /></option>
|
<option id="gnu.c.compiler.option.preprocessor.def.symbols.281399675" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"><listOptionValue builtIn="false" value="__weak="__attribute__((weak))"" /><listOptionValue builtIn="false" value="__packed="__attribute__((__packed__))"" /><listOptionValue builtIn="false" value="USE_HAL_DRIVER" /><listOptionValue builtIn="false" value="STM32F103xE" /></option>
|
||||||
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.1123473232" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" value="-fmessage-length=0" valueType="string" />
|
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.1123473232" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" value="-fmessage-length=0" valueType="string" />
|
||||||
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.2046095481" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c" />
|
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.2046095481" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c" />
|
||||||
|
@ -160,21 +160,21 @@ static void MX_RTC_Init(void)
|
|||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
sTime.Hours = 0x1;
|
sTime.Hours = 1;
|
||||||
sTime.Minutes = 0x0;
|
sTime.Minutes = 0;
|
||||||
sTime.Seconds = 0x0;
|
sTime.Seconds = 0;
|
||||||
|
|
||||||
if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK)
|
if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BIN) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
DateToUpdate.WeekDay = RTC_WEEKDAY_MONDAY;
|
DateToUpdate.WeekDay = RTC_WEEKDAY_MONDAY;
|
||||||
DateToUpdate.Month = RTC_MONTH_JANUARY;
|
DateToUpdate.Month = RTC_MONTH_JANUARY;
|
||||||
DateToUpdate.Date = 0x1;
|
DateToUpdate.Date = 1;
|
||||||
DateToUpdate.Year = 0x0;
|
DateToUpdate.Year = 0;
|
||||||
|
|
||||||
if (HAL_RTC_SetDate(&hrtc, &DateToUpdate, RTC_FORMAT_BCD) != HAL_OK)
|
if (HAL_RTC_SetDate(&hrtc, &DateToUpdate, RTC_FORMAT_BIN) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,8 @@ RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
|||||||
RCC.TimSysFreq_Value=72000000
|
RCC.TimSysFreq_Value=72000000
|
||||||
RCC.USBFreq_Value=72000000
|
RCC.USBFreq_Value=72000000
|
||||||
RCC.VCOOutput2Freq_Value=8000000
|
RCC.VCOOutput2Freq_Value=8000000
|
||||||
|
RTC.Format=RTC_FORMAT_BIN
|
||||||
|
RTC.IPParameters=Format
|
||||||
VP_RTC_No_RTC_Output.Mode=RTC_OUT_NO
|
VP_RTC_No_RTC_Output.Mode=RTC_OUT_NO
|
||||||
VP_RTC_No_RTC_Output.Signal=RTC_No_RTC_Output
|
VP_RTC_No_RTC_Output.Signal=RTC_No_RTC_Output
|
||||||
VP_SYS_VS_Systick.Mode=SysTick
|
VP_SYS_VS_Systick.Mode=SysTick
|
||||||
|
14
src/main.c
14
src/main.c
@ -164,21 +164,21 @@ static void MX_RTC_Init(void)
|
|||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
sTime.Hours = 0x1;
|
sTime.Hours = 1;
|
||||||
sTime.Minutes = 0x0;
|
sTime.Minutes = 0;
|
||||||
sTime.Seconds = 0x0;
|
sTime.Seconds = 0;
|
||||||
|
|
||||||
if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK)
|
if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BIN) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
DateToUpdate.WeekDay = RTC_WEEKDAY_MONDAY;
|
DateToUpdate.WeekDay = RTC_WEEKDAY_MONDAY;
|
||||||
DateToUpdate.Month = RTC_MONTH_JANUARY;
|
DateToUpdate.Month = RTC_MONTH_JANUARY;
|
||||||
DateToUpdate.Date = 0x1;
|
DateToUpdate.Date = 1;
|
||||||
DateToUpdate.Year = 0x0;
|
DateToUpdate.Year = 0;
|
||||||
|
|
||||||
if (HAL_RTC_SetDate(&hrtc, &DateToUpdate, RTC_FORMAT_BCD) != HAL_OK)
|
if (HAL_RTC_SetDate(&hrtc, &DateToUpdate, RTC_FORMAT_BIN) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
@ -160,21 +160,21 @@ static void MX_RTC_Init(void)
|
|||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
sTime.Hours = 0x1;
|
sTime.Hours = 1;
|
||||||
sTime.Minutes = 0x0;
|
sTime.Minutes = 0;
|
||||||
sTime.Seconds = 0x0;
|
sTime.Seconds = 0;
|
||||||
|
|
||||||
if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK)
|
if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BIN) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
DateToUpdate.WeekDay = RTC_WEEKDAY_MONDAY;
|
DateToUpdate.WeekDay = RTC_WEEKDAY_MONDAY;
|
||||||
DateToUpdate.Month = RTC_MONTH_JANUARY;
|
DateToUpdate.Month = RTC_MONTH_JANUARY;
|
||||||
DateToUpdate.Date = 0x1;
|
DateToUpdate.Date = 1;
|
||||||
DateToUpdate.Year = 0x0;
|
DateToUpdate.Year = 0;
|
||||||
|
|
||||||
if (HAL_RTC_SetDate(&hrtc, &DateToUpdate, RTC_FORMAT_BCD) != HAL_OK)
|
if (HAL_RTC_SetDate(&hrtc, &DateToUpdate, RTC_FORMAT_BIN) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user