Browse Source

清除编码器1按键好使,清除编码器2按键不好使,需要排查问题

tags/修改需求前并且硬件测试除rs485都通过的版本
tianjialong 2 years ago
parent
commit
427d02d1a9
  1. 6
      LWIP.ioc
  2. 106
      MDK-ARM/LWIP.uvguix.29643
  3. 50
      MDK-ARM/LWIP.uvoptx
  4. 1088
      MDK-ARM/LWIP.uvprojx
  5. 6
      Src/freertos.c
  6. 2
      Src/gpio.c
  7. 8
      usersrc/usermain.c

6
LWIP.ioc

@ -140,12 +140,14 @@ PC6.Signal=S_TIM8_CH1
PC7.GPIOParameters=GPIO_PuPd
PC7.GPIO_PuPd=GPIO_PULLUP
PC7.Signal=S_TIM8_CH2
PD0.GPIOParameters=GPIO_Label
PD0.GPIOParameters=GPIO_PuPd,GPIO_Label
PD0.GPIO_Label=KEY0
PD0.GPIO_PuPd=GPIO_PULLUP
PD0.Locked=true
PD0.Signal=GPIO_Input
PD1.GPIOParameters=GPIO_Label
PD1.GPIOParameters=GPIO_PuPd,GPIO_Label
PD1.GPIO_Label=KEY1
PD1.GPIO_PuPd=GPIO_PULLUP
PD1.Locked=true
PD1.Signal=GPIO_Input
PD12.GPIOParameters=GPIO_PuPd

106
MDK-ARM/LWIP.uvguix.29643
File diff suppressed because it is too large
View File

50
MDK-ARM/LWIP.uvoptx

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion>
@ -45,7 +45,7 @@
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath />
<ListingPath></ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
@ -104,16 +104,16 @@
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>3</nTsel>
<sDll />
<sDllPa />
<sDlgDll />
<sDlgPa />
<sIfile />
<tDll />
<tDllPa />
<tDlgDll />
<tDlgPa />
<tIfile />
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
<sDlgPa></sDlgPa>
<sIfile></sIfile>
<tDll></tDll>
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<pMon>BIN\CMSIS_AGDI.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
@ -130,12 +130,12 @@
<SetRegEntry>
<Number>0</Number>
<Key>ARMDBGFLAGS</Key>
<Name />
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name />
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@ -153,7 +153,7 @@
<Name>-U-O142 -O2254 -S0 -C0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F407ZETx$CMSIS\Flash\STM32F4xx_512.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint />
<Breakpoint/>
<WatchWindow1>
<Ww>
<count>0</count>
@ -195,19 +195,19 @@
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable />
<LintConfigFile />
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags>
<pMisraName />
<pszMrule />
<pSingCmds />
<pMultCmds />
<pMisraNamep />
<pszMrulep />
<pSingCmdsp />
<pMultCmdsp />
<pMisraName></pMisraName>
<pszMrule></pszMrule>
<pSingCmds></pSingCmds>
<pMultCmds></pMultCmds>
<pMisraNamep></pMisraNamep>
<pszMrulep></pszMrulep>
<pSingCmdsp></pSingCmdsp>
<pMultCmdsp></pMultCmdsp>
<DebugDescription>
<Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq>

1088
MDK-ARM/LWIP.uvprojx
File diff suppressed because it is too large
View File

6
Src/freertos.c

@ -157,13 +157,7 @@ void MX_FREERTOS_Init(void) {
void StartDefaultTask(void const * argument)
{
/* init code for LWIP */
if (config_get()->obtaining_ip_mode == OBTAINING_IP_MODE_STATIC){
MX_LWIP_STATIC_Init();
}else if (config_get()->obtaining_ip_mode == OBTAINING_IP_MODE_DHCP){
MX_LWIP_Init();
}else{
printf("lwip error\r\n");
}
/* USER CODE BEGIN StartDefaultTask */
osThreadDef(mainTask, StartMainTask, osPriorityNormal, 0, 1024);
mainTaskHandle = osThreadCreate(osThread(mainTask), NULL);

2
Src/gpio.c

@ -85,7 +85,7 @@ void MX_GPIO_Init(void)
/*Configure GPIO pins : PDPin PDPin */
GPIO_InitStruct.Pin = KEY0_Pin|KEY1_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
/*Configure GPIO pin : PtPin */

8
usersrc/usermain.c

@ -22,8 +22,8 @@
static uint16_t s_key_long_press_time_ms = 3000;
static inline bool clear_encoder_1_key_get_status() { return HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_4); }
static inline bool clear_encoder_2_key_get_status() { return HAL_GPIO_ReadPin(GPIOE, GPIO_PIN_3); }
static inline bool clear_encoder_1_key_get_status() { return HAL_GPIO_ReadPin(KEY0_GPIO_Port, KEY0_Pin); }
static inline bool clear_encoder_2_key_get_status() { return HAL_GPIO_ReadPin(KEY1_GPIO_Port, KEY1_Pin); }
static void onkey(zkey_t *key, zkey_state_t key_state);
static zkey_t s_keys[] = {
@ -105,14 +105,14 @@ void user_main()
encoder_all_start();
udp_client_init();
// zkey_init(&s_key_module);
zkey_init(&s_key_module);
// port_uart_start_all_uart_receive();
while (1)
{
// udp_client_genlock_and_esync_active();
// udp_client_active();
// zkey_schedule();
zkey_schedule();
udp_client_recv();
// at_cmd_processer_try_process_data();
// encoder_light_schedule();

Loading…
Cancel
Save