Browse Source

可以点亮两个RGB灯

tags/修改需求前并且硬件测试除rs485都通过的版本
tianjialong 2 years ago
parent
commit
d494407d66
  1. 23
      MDK-ARM/LWIP.uvguix.29643
  2. 48
      MDK-ARM/LWIP.uvoptx
  3. 1080
      MDK-ARM/LWIP.uvprojx
  4. 20
      usersrc/encoder.c
  5. 7
      usersrc/usermain.c

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

48
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"> <ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion> <SchemaVersion>1.0</SchemaVersion>
@ -45,7 +45,7 @@
<PageWidth>79</PageWidth> <PageWidth>79</PageWidth>
<PageLength>66</PageLength> <PageLength>66</PageLength>
<TabStop>8</TabStop> <TabStop>8</TabStop>
<ListingPath />
<ListingPath></ListingPath>
</OPTLEX> </OPTLEX>
<ListingPage> <ListingPage>
<CreateCListing>1</CreateCListing> <CreateCListing>1</CreateCListing>
@ -104,16 +104,16 @@
<bSchkAxf>0</bSchkAxf> <bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf> <bTchkAxf>0</bTchkAxf>
<nTsel>3</nTsel> <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> <pMon>BIN\CMSIS_AGDI.dll</pMon>
</DebugOpt> </DebugOpt>
<TargetDriverDllRegistry> <TargetDriverDllRegistry>
@ -130,12 +130,12 @@
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>ARMDBGFLAGS</Key> <Key>ARMDBGFLAGS</Key>
<Name />
<Name></Name>
</SetRegEntry> </SetRegEntry>
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>DLGUARM</Key> <Key>DLGUARM</Key>
<Name />
<Name></Name>
</SetRegEntry> </SetRegEntry>
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
@ -195,19 +195,19 @@
<newCpu>0</newCpu> <newCpu>0</newCpu>
<uProt>0</uProt> <uProt>0</uProt>
</DebugFlag> </DebugFlag>
<LintExecutable />
<LintConfigFile />
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto> <bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD> <bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags> <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> <DebugDescription>
<Enable>1</Enable> <Enable>1</Enable>
<EnableFlashSeq>0</EnableFlashSeq> <EnableFlashSeq>0</EnableFlashSeq>

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

20
usersrc/encoder.c

@ -76,14 +76,14 @@ bool encoder_read_with_encoder(encoder_usage_t encoder, uint32_t *encoder_value)
void encoder_light_schedule(void) void encoder_light_schedule(void)
{ {
if (camera_encoder_state == STANDBY)
{
if (sys_haspassedms(camera_encoder_lastprocess) > 500)
{
camera_encoder_lastprocess = HAL_GetTick();
HAL_GPIO_TogglePin(ENCODER_LIGHT_GPIO_Port, ENCODER_LIGHT_Pin);
}
}
// if (camera_encoder_state == STANDBY)
// {
// if (sys_haspassedms(camera_encoder_lastprocess) > 500)
// {
// camera_encoder_lastprocess = HAL_GetTick();
// HAL_GPIO_TogglePin(ENCODER_LIGHT_GPIO_Port, ENCODER_LIGHT_Pin);
// }
// }
if (driven_encoder_gear_state == STANDBY) if (driven_encoder_gear_state == STANDBY)
{ {
@ -104,12 +104,12 @@ void encoder_set_state(encoder_usage_t encoder, encoder_light_state_t state)
if (state == STANDBY) if (state == STANDBY)
{ {
camera_encoder_lastprocess = HAL_GetTick(); camera_encoder_lastprocess = HAL_GetTick();
HAL_GPIO_TogglePin(ENCODER_LIGHT_GPIO_Port, ENCODER_LIGHT_Pin);
// HAL_GPIO_TogglePin(ENCODER_LIGHT_GPIO_Port, ENCODER_LIGHT_Pin);
} }
else if (state == WORKING) else if (state == WORKING)
{ {
/* 如果工作状态的时候触发了genlock等,灯的状态不应该变成待机状态,只有同为待机的时候闪烁,上层写的时候需要加判断 */ /* 如果工作状态的时候触发了genlock等,灯的状态不应该变成待机状态,只有同为待机的时候闪烁,上层写的时候需要加判断 */
HAL_GPIO_WritePin(ENCODER_LIGHT_GPIO_Port, ENCODER_LIGHT_Pin, GPIO_PIN_RESET);
// HAL_GPIO_WritePin(ENCODER_LIGHT_GPIO_Port, ENCODER_LIGHT_Pin, GPIO_PIN_RESET);
} }
} }
else if (encoder == DRIVEN_ENCODER_GEAR) else if (encoder == DRIVEN_ENCODER_GEAR)

7
usersrc/usermain.c

@ -103,6 +103,13 @@ void user_main()
printf("==============ethernet_sound_acquisition_card=============\r\n"); printf("==============ethernet_sound_acquisition_card=============\r\n");
printf("version %d.%d", VERSION_MAIN_ID, VERSION_SUB_ID); printf("version %d.%d", VERSION_MAIN_ID, VERSION_SUB_ID);
HAL_GPIO_WritePin(DIS_R1_GPIO_Port, DIS_R1_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(DIS_G1_GPIO_Port, DIS_G1_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(DIS_B1_GPIO_Port, DIS_B1_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(DIS_R2_GPIO_Port, DIS_R2_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(DIS_G2_GPIO_Port, DIS_G2_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(DIS_B2_GPIO_Port, DIS_B2_Pin, GPIO_PIN_SET);
encoder_all_start(); encoder_all_start();
udp_client_init(); udp_client_init();
zkey_init(&s_key_module); zkey_init(&s_key_module);

Loading…
Cancel
Save