Browse Source

外部中断genlock触发时,设置标志位,发送数据,当前使用按键充当genlock,会有抖动

external_Interrupt
tianjialong 2 years ago
parent
commit
fe54d6c8c8
  1. 3
      LWIP.ioc
  2. 72
      MDK-ARM/LWIP.uvguix.29643
  3. 52
      MDK-ARM/LWIP.uvoptx
  4. 1088
      MDK-ARM/LWIP.uvprojx
  5. 4
      Src/gpio.c
  6. 2
      Src/lwip.c
  7. 9
      usersrc/udpclient.c
  8. 5
      usersrc/udpclient.h
  9. 12
      usersrc/usermain.c

3
LWIP.ioc

@ -141,6 +141,9 @@ PD3.GPIOParameters=GPIO_Label
PD3.GPIO_Label=ETH_RST
PD3.Locked=true
PD3.Signal=GPIO_Output
PE2.GPIOParameters=GPIO_PuPd,GPIO_ModeDefaultEXTI
PE2.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
PE2.GPIO_PuPd=GPIO_PULLUP
PE2.Locked=true
PE2.Signal=GPXTI2
PE3.GPIOParameters=GPIO_PuPd

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

52
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>
@ -167,7 +167,7 @@
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\usersrc\atcmd.c</Filename>
<ExecCommand />
<ExecCommand></ExecCommand>
<Expression>\\LWIP\../usersrc/atcmd.c\132</Expression>
</Bp>
<Bp>
@ -183,7 +183,7 @@
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>../Src/ethernetif.c</Filename>
<ExecCommand />
<ExecCommand></ExecCommand>
<Expression>\\LWIP\../Src/ethernetif.c\198</Expression>
</Bp>
</Breakpoint>
@ -228,19 +228,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

4
Src/gpio.c

@ -61,8 +61,8 @@ void MX_GPIO_Init(void)
/*Configure GPIO pin : PE2 */
GPIO_InitStruct.Pin = GPIO_PIN_2;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
/*Configure GPIO pins : PE3 PE4 */

2
Src/lwip.c

@ -135,7 +135,7 @@ void MX_LWIP_Init(void)
if (!netif_is_up(&gnetif)){
netif_set_up(&gnetif);
if (dhcp_start(&gnetif) == ERR_ARG){
NVIC_SystemReset(); /* 软å¤�ä½ */
NVIC_SystemReset(); /* 软�� */
}
}

9
usersrc/udpclient.c

@ -258,7 +258,7 @@ void udp_client_parse(int recv_datalen)
}
}
void udp_cllient_active(void)
void udp_client_active(void)
{
if (udp_client_active_flag)
{
@ -273,7 +273,7 @@ void udp_cllient_active(void)
}
}
void udp_cllient_genlock_and_esync_active(void)
void udp_client_genlock_and_esync_active(void)
{
if (genlock_and_esync_active_flag)
{
@ -285,3 +285,8 @@ void udp_cllient_genlock_and_esync_active(void)
genlock_and_esync_active_flag = false;
}
}
bool *udp_client_genlock_and_esync_active_flag_ret(void)
{
return &genlock_and_esync_active_flag;
}

5
usersrc/udpclient.h

@ -7,5 +7,6 @@ void udp_client_init(void);
void udp_client_send_string(char *pData);
void udp_client_recv(void);
void udp_client_parse(int recv_datalen);
void udp_cllient_active(void);
void udp_cllient_genlock_and_esync_active(void);
void udp_client_active(void);
void udp_client_genlock_and_esync_active(void);
bool *udp_client_genlock_and_esync_active_flag_ret(void);

12
usersrc/usermain.c

@ -90,6 +90,14 @@ void port_mock_on_uart_rx(uart_t *uart)
}
}
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
if (GPIO_Pin == GPIO_PIN_2)
{
*udp_client_genlock_and_esync_active_flag_ret() = true;
}
}
void user_main()
{
printf("==============ethernet_sound_acquisition_card=============\r\n");
@ -103,8 +111,8 @@ void user_main()
while (1)
{
udp_cllient_genlock_and_esync_active();
udp_cllient_active();
udp_client_genlock_and_esync_active();
udp_client_active();
zkey_schedule();
udp_client_recv();
at_cmd_processer_try_process_data();

Loading…
Cancel
Save