backup
parent
a83be190aa
commit
33092db4ce
|
@ -6,7 +6,7 @@
|
|||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-851227371371128580" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="758376557953507568" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-851227371371128580" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="758376557953507568" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
|
|
@ -187,9 +187,8 @@ void StartDefaultTask(void *argument)
|
|||
MX_USB_DEVICE_Init();
|
||||
/* USER CODE BEGIN StartDefaultTask */
|
||||
|
||||
NaviKit_var_init();
|
||||
HAL_GPIO_WritePin(USB2_FS_ENUM_CTL_GPIO_Port,USB2_FS_ENUM_CTL_Pin, GPIO_PIN_SET);
|
||||
Beep(50);
|
||||
// Beep(50);
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
{
|
||||
|
@ -233,7 +232,6 @@ void StartLedBlinkTask(void *argument)
|
|||
{
|
||||
if(!HAL_GPIO_ReadPin(SYS_POWER_LED_CTL_GPIO_Port,SYS_POWER_LED_CTL_Pin))
|
||||
HAL_GPIO_WritePin(SYS_POWER_LED_CTL_GPIO_Port,SYS_POWER_LED_CTL_Pin,GPIO_PIN_SET);//turn off power led
|
||||
|
||||
|
||||
if(HAL_GPIO_ReadPin(SYS_RUN_LED_CTL_GPIO_Port,SYS_RUN_LED_CTL_Pin) == GPIO_PIN_SET)//sys run led is off
|
||||
{
|
||||
|
@ -246,27 +244,27 @@ void StartLedBlinkTask(void *argument)
|
|||
osDelay(2000);
|
||||
}
|
||||
}
|
||||
else if(NaviKit.sys.sta == sleep)
|
||||
else
|
||||
{
|
||||
for(uint16_t i=0;i<20;i++)
|
||||
for(uint16_t i=0;i<25;i++)
|
||||
{//20 light level
|
||||
for(uint16_t j=0;j<4;j++)
|
||||
for(uint16_t j=0;j<3;j++)
|
||||
{//the time length of every light level
|
||||
HAL_GPIO_WritePin(SYS_POWER_LED_CTL_GPIO_Port,SYS_POWER_LED_CTL_Pin,GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(SYS_RUN_LED_CTL_GPIO_Port,SYS_RUN_LED_CTL_Pin,GPIO_PIN_SET);
|
||||
osDelay(i);
|
||||
HAL_GPIO_WritePin(SYS_POWER_LED_CTL_GPIO_Port,SYS_POWER_LED_CTL_Pin,GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(SYS_RUN_LED_CTL_GPIO_Port,SYS_RUN_LED_CTL_Pin,GPIO_PIN_RESET);
|
||||
osDelay(20-i);
|
||||
osDelay(25-i);
|
||||
}
|
||||
}
|
||||
for(uint16_t i=0;i<20;i++)
|
||||
for(uint16_t i=0;i<25;i++)
|
||||
{
|
||||
for(uint16_t j=0;j<4;j++)
|
||||
for(uint16_t j=0;j<3;j++)
|
||||
{
|
||||
HAL_GPIO_WritePin(SYS_POWER_LED_CTL_GPIO_Port,SYS_POWER_LED_CTL_Pin,GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(SYS_RUN_LED_CTL_GPIO_Port,SYS_RUN_LED_CTL_Pin,GPIO_PIN_SET);
|
||||
osDelay(20-i);
|
||||
osDelay(25-i);
|
||||
HAL_GPIO_WritePin(SYS_POWER_LED_CTL_GPIO_Port,SYS_POWER_LED_CTL_Pin,GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(SYS_RUN_LED_CTL_GPIO_Port,SYS_RUN_LED_CTL_Pin,GPIO_PIN_RESET);
|
||||
osDelay(i);
|
||||
|
@ -317,35 +315,23 @@ void StartButtonDetect(void *argument)
|
|||
osDelay(1000);
|
||||
if(NaviKit.sys.power_btn == true)
|
||||
{//power btn has been pushed more than 1000 ms
|
||||
// while(NaviKit.sys.power_btn == true);//wait to release button
|
||||
if(NaviKit.sys.sta == runing)
|
||||
{//system is runing now, user request to shutdown
|
||||
enter_shutdown_state();
|
||||
NaviKit.sys.sta = shutdown;
|
||||
printf("shutdown \n");
|
||||
Beep(50);
|
||||
|
||||
|
||||
NaviKit.sys.sta = shutdown;
|
||||
}
|
||||
else if(NaviKit.sys.sta == shutdown)
|
||||
{//system is shutdown now , user request to power on
|
||||
NaviKit.sys.sta = runing;
|
||||
printf("power on \n");
|
||||
Beep(200);
|
||||
osDelay(500);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(NaviKit.sys.sta == runing)
|
||||
{
|
||||
NaviKit.sys.sta = sleep;
|
||||
}
|
||||
else if(NaviKit.sys.sta == sleep)
|
||||
{
|
||||
NaviKit.sys.sta = runing;
|
||||
}
|
||||
|
||||
//sleep mode is unused
|
||||
// if(NaviKit.sys.sta == runing)
|
||||
// NaviKit.sys.sta = sleep;
|
||||
// else if(NaviKit.sys.sta == sleep)
|
||||
// NaviKit.sys.sta = runing;
|
||||
}
|
||||
}
|
||||
if(NaviKit.sys.custom_btn == true )
|
||||
|
@ -353,9 +339,17 @@ void StartButtonDetect(void *argument)
|
|||
osDelay(1000);
|
||||
if(NaviKit.sys.custom_btn == true )
|
||||
{//custom button has been pushed over 1000 ms
|
||||
// while(NaviKit.sys.custom_btn == true);//wait to release button
|
||||
if(NaviKit.sys.sta == runing)
|
||||
{
|
||||
// restart();
|
||||
//restart usb3.0 gigabit ethernet controler
|
||||
HAL_GPIO_WritePin(SOC_U3_GEC_PWR_CTL_GPIO_Port,SOC_U3_GEC_PWR_CTL_Pin,GPIO_PIN_RESET);
|
||||
// HAL_GPIO_WritePin(SOC_U3_HOST_PWR_CTL_GPIO_Port,SOC_U3_HOST_PWR_CTL_Pin, GPIO_PIN_RESET);
|
||||
Beep(50);
|
||||
osDelay(1000);
|
||||
HAL_GPIO_WritePin(SOC_U3_GEC_PWR_CTL_GPIO_Port,SOC_U3_GEC_PWR_CTL_Pin,GPIO_PIN_SET);
|
||||
// HAL_GPIO_WritePin(SOC_U3_HOST_PWR_CTL_GPIO_Port,SOC_U3_HOST_PWR_CTL_Pin, GPIO_PIN_RESET);
|
||||
Beep(50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -410,6 +404,8 @@ void StartStateSwitchTask(void *argument)
|
|||
/* Infinite loop */
|
||||
for(;;)
|
||||
{
|
||||
NaviKit.sys.last_sta = NaviKit.sys.sta;
|
||||
osDelay(10);
|
||||
if(NaviKit.sys.last_sta != NaviKit.sys.sta)
|
||||
switch(NaviKit.sys.sta)
|
||||
{
|
||||
|
@ -429,7 +425,6 @@ void StartStateSwitchTask(void *argument)
|
|||
|
||||
}break;
|
||||
}
|
||||
osDelay(10);
|
||||
}
|
||||
/* USER CODE END StartStateSwitchTask */
|
||||
}
|
||||
|
@ -481,13 +476,16 @@ void sys_stop()
|
|||
|
||||
void enter_shutdown_state()
|
||||
{
|
||||
printf("Enter to shutdown state \n");
|
||||
Beep(50);
|
||||
|
||||
HAL_GPIO_WritePin(SOM_POWER_EN_GPIO_Port ,SOM_POWER_EN_Pin, GPIO_PIN_RESET); osDelay(100);
|
||||
|
||||
for(uint8_t i=0;i<100;i++)
|
||||
{
|
||||
if(HAL_GPIO_ReadPin(SOM_SHUTDOWN_REQ_GPIO_Port,SOM_SHUTDOWN_REQ_Pin))
|
||||
osDelay(10);
|
||||
}
|
||||
// for(uint8_t i=0;i<100;i++)
|
||||
// {
|
||||
// if(HAL_GPIO_ReadPin(SOM_SHUTDOWN_REQ_GPIO_Port,SOM_SHUTDOWN_REQ_Pin))
|
||||
// osDelay(10);
|
||||
// }
|
||||
|
||||
HAL_GPIO_WritePin(SOC_U3_HUB_PWR_CTL_GPIO_Port,SOC_U3_HUB_PWR_CTL_Pin, GPIO_PIN_RESET); osDelay(100);
|
||||
HAL_GPIO_WritePin(SOC_U2_HUB_PWR_CTL_GPIO_Port,SOC_U2_HUB_PWR_CTL_Pin, GPIO_PIN_RESET); osDelay(100);
|
||||
|
@ -519,6 +517,9 @@ void enter_shutdown_state()
|
|||
}
|
||||
void enter_sleep_state()
|
||||
{
|
||||
printf("Enter to sleep state \n");
|
||||
Beep(50);
|
||||
|
||||
// HAL_GPIO_WritePin(SOC_U3_HUB_PWR_CTL_GPIO_Port,SOC_U3_HUB_PWR_CTL_Pin, GPIO_PIN_RESET); osDelay(100);
|
||||
HAL_GPIO_WritePin(SOC_U2_HUB_PWR_CTL_GPIO_Port,SOC_U2_HUB_PWR_CTL_Pin, GPIO_PIN_RESET); osDelay(100);
|
||||
HAL_GPIO_WritePin(SOC_U3_HOST_PWR_CTL_GPIO_Port,SOC_U3_HOST_PWR_CTL_Pin, GPIO_PIN_RESET); osDelay(100);
|
||||
|
@ -548,6 +549,10 @@ void enter_sleep_state()
|
|||
}
|
||||
void enter_runing_state()
|
||||
{
|
||||
|
||||
printf("Enter to runing state \n");
|
||||
Beep(200);
|
||||
|
||||
HAL_GPIO_WritePin(PMB_PS_ON_GPIO_Port ,PMB_PS_ON_Pin, GPIO_PIN_SET); osDelay(100);
|
||||
|
||||
HAL_GPIO_WritePin(SYS_FAN_CTL_1_GPIO_Port,SYS_FAN_CTL_1_Pin,GPIO_PIN_SET); osDelay(100);
|
||||
|
|
|
@ -57,22 +57,30 @@ void MX_GPIO_Init(void)
|
|||
HAL_GPIO_WritePin(GPIOE, PMB_PS_ON_Pin|SYS_FAN_CTL_1_Pin|SYS_FAN_CTL_2_Pin|SYS_FAN_CTL_3_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, PMB_CHRG_SHDN_Pin|PMB_TEMP_SEN_EN_Pin|SYS_RUN_LED_CTL_Pin|SYS_BUZZ_CTL_Pin
|
||||
|SOC_U2_HUB_PWR_CTL_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOC, PMB_CHRG_SHDN_Pin|SYS_BUZZ_CTL_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, PMB_TEMP_SEN_EN_Pin|SYS_RUN_LED_CTL_Pin|SOC_U2_HUB_PWR_CTL_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOB, IIC2_SCL_Pin|IIC2_SDA_Pin|USB2_VBUS_CTL_1_Pin|USB2_VBUS_CTL_2_Pin
|
||||
|USB2_VBUS_CTL_3_Pin|USB2_VBUS_CTL_4_Pin|SOM_SYS_RESET_Pin, GPIO_PIN_RESET);
|
||||
|USB2_VBUS_CTL_3_Pin|USB2_VBUS_CTL_4_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOD, USB2_VBUS_CTL_5_Pin|USB2_VBUS_CTL_6_Pin|USB3_VBUS_CTL_5_Pin|USB3_VBUS_CTL_6_Pin
|
||||
|USB3_VBUS_CTL_1_Pin|USB3_VBUS_CTL_2_Pin|USB3_VBUS_CTL_3_Pin|USB3_VBUS_CTL_4_Pin
|
||||
|SOC_U3_HUB_PWR_CTL_Pin|SOC_U3_HOST_PWR_CTL_Pin|SOC_U3_GEC_PWR_CTL_Pin|SOC_GE_SW_PWR_CTL_Pin
|
||||
|SOM_POWER_EN_Pin|SOM_SLEEP_WAKE_Pin|SOM_FORCE_RECOVERY_Pin, GPIO_PIN_RESET);
|
||||
|SOM_POWER_EN_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(USB2_FS_ENUM_CTL_GPIO_Port, USB2_FS_ENUM_CTL_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOD, SOM_SLEEP_WAKE_Pin|SOM_FORCE_RECOVERY_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(SOM_SYS_RESET_GPIO_Port, SOM_SYS_RESET_Pin, GPIO_PIN_SET);
|
||||
|
||||
/*Configure GPIO pins : PEPin PEPin PEPin PEPin
|
||||
PEPin */
|
||||
GPIO_InitStruct.Pin = SYS_POWER_LED_CTL_Pin|PMB_PS_ON_Pin|SYS_FAN_CTL_1_Pin|SYS_FAN_CTL_2_Pin
|
||||
|
@ -191,7 +199,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
if(HAL_GPIO_ReadPin(SYS_POWER_BTN_GPIO_Port, SYS_POWER_BTN_Pin)==GPIO_PIN_RESET)
|
||||
{//falling edge trigger
|
||||
NaviKit.sys.power_btn = false;
|
||||
printf("pwr_btn poped \n");
|
||||
printf("pwr_btn released \n");
|
||||
}
|
||||
}
|
||||
else if(GPIO_Pin == SYS_CUSTOM_BTN_Pin)
|
||||
|
@ -199,7 +207,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
if(HAL_GPIO_ReadPin(SYS_CUSTOM_BTN_GPIO_Port, SYS_CUSTOM_BTN_Pin)==GPIO_PIN_SET)
|
||||
{//Rising edge trigger
|
||||
NaviKit.sys.custom_btn = false;
|
||||
printf("cus_btn poped \n");
|
||||
printf("cus_btn released \n");
|
||||
}
|
||||
if(HAL_GPIO_ReadPin(SYS_CUSTOM_BTN_GPIO_Port, SYS_CUSTOM_BTN_Pin)==GPIO_PIN_RESET)
|
||||
{//falling edge trigger
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
#include <stdio.h>
|
||||
#include "navikit.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
@ -83,6 +84,7 @@ int main(void)
|
|||
|
||||
/* USER CODE BEGIN Init */
|
||||
|
||||
NaviKit_var_init();
|
||||
/* USER CODE END Init */
|
||||
|
||||
/* Configure the system clock */
|
||||
|
|
|
@ -1027,7 +1027,7 @@ void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd)
|
|||
#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
|
||||
hpcd->SuspendCallback(hpcd);
|
||||
#else
|
||||
HAL_PCD_SuspendCallback(hpcd);
|
||||
//HAL_PCD_SuspendCallback(hpcd);
|
||||
#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
|
||||
}
|
||||
__HAL_PCD_CLEAR_FLAG(hpcd, USB_OTG_GINTSTS_USBSUSP);
|
||||
|
|
|
@ -260,9 +260,10 @@ PB3.GPIOParameters=GPIO_Label
|
|||
PB3.GPIO_Label=SYS_SWO
|
||||
PB3.Mode=Trace_Asynchronous_SW
|
||||
PB3.Signal=SYS_TRACESWO
|
||||
PB4.GPIOParameters=GPIO_Label
|
||||
PB4.GPIOParameters=PinState,GPIO_Label
|
||||
PB4.GPIO_Label=SOM_SYS_RESET
|
||||
PB4.Locked=true
|
||||
PB4.PinState=GPIO_PIN_SET
|
||||
PB4.Signal=GPIO_Output
|
||||
PB5.GPIOParameters=GPIO_Label
|
||||
PB5.GPIO_Label=SOM_MOD_SLEEP
|
||||
|
@ -284,9 +285,10 @@ PB9.GPIO_Label=IIC1_SDA
|
|||
PB9.Locked=true
|
||||
PB9.Mode=I2C
|
||||
PB9.Signal=I2C1_SDA
|
||||
PC0.GPIOParameters=GPIO_Label
|
||||
PC0.GPIOParameters=PinState,GPIO_Label
|
||||
PC0.GPIO_Label=PMB_CHRG_SHDN
|
||||
PC0.Locked=true
|
||||
PC0.PinState=GPIO_PIN_SET
|
||||
PC0.Signal=GPIO_Output
|
||||
PC1.GPIOParameters=GPIO_Label
|
||||
PC1.GPIO_Label=PMB_TEMP_SEN_EN
|
||||
|
@ -314,9 +316,10 @@ PC4.GPIOParameters=GPIO_Label
|
|||
PC4.GPIO_Label=SYS_RUN_LED_CTL
|
||||
PC4.Locked=true
|
||||
PC4.Signal=GPIO_Output
|
||||
PC5.GPIOParameters=GPIO_Label
|
||||
PC5.GPIOParameters=PinState,GPIO_Label
|
||||
PC5.GPIO_Label=SYS_BUZZ_CTL
|
||||
PC5.Locked=true
|
||||
PC5.PinState=GPIO_PIN_SET
|
||||
PC5.Signal=GPIO_Output
|
||||
PD0.GPIOParameters=GPIO_Label
|
||||
PD0.GPIO_Label=SOC_U3_HUB_PWR_CTL
|
||||
|
@ -366,13 +369,15 @@ PD5.GPIOParameters=GPIO_Label
|
|||
PD5.GPIO_Label=SOM_SHUTDOWN_REQ
|
||||
PD5.Locked=true
|
||||
PD5.Signal=GPIO_Input
|
||||
PD6.GPIOParameters=GPIO_Label
|
||||
PD6.GPIOParameters=PinState,GPIO_Label
|
||||
PD6.GPIO_Label=SOM_SLEEP_WAKE
|
||||
PD6.Locked=true
|
||||
PD6.PinState=GPIO_PIN_SET
|
||||
PD6.Signal=GPIO_Output
|
||||
PD7.GPIOParameters=GPIO_Label
|
||||
PD7.GPIOParameters=PinState,GPIO_Label
|
||||
PD7.GPIO_Label=SOM_FORCE_RECOVERY
|
||||
PD7.Locked=true
|
||||
PD7.PinState=GPIO_PIN_SET
|
||||
PD7.Signal=GPIO_Output
|
||||
PD8.GPIOParameters=GPIO_Label
|
||||
PD8.GPIO_Label=USB2_VBUS_CTL_5
|
||||
|
|
Loading…
Reference in New Issue