备份 -- 轮询查询CH438中断寄存器
This commit is contained in:
parent
429bf9dc68
commit
a99c50e1d5
|
@ -78,7 +78,6 @@ void Error_Handler(void);
|
|||
#define HART9_RTS_GPIO_Port GPIOB
|
||||
#define CH438_2_INT_Pin GPIO_PIN_13
|
||||
#define CH438_2_INT_GPIO_Port GPIOF
|
||||
#define CH438_2_INT_EXTI_IRQn EXTI15_10_IRQn
|
||||
#define CH438_AMOD_Pin GPIO_PIN_14
|
||||
#define CH438_AMOD_GPIO_Port GPIOF
|
||||
#define HART8_RTS_Pin GPIO_PIN_0
|
||||
|
@ -109,7 +108,6 @@ void Error_Handler(void);
|
|||
#define HART13_RTS_GPIO_Port GPIOC
|
||||
#define CH438_1_INT_Pin GPIO_PIN_2
|
||||
#define CH438_1_INT_GPIO_Port GPIOD
|
||||
#define CH438_1_INT_EXTI_IRQn EXTI2_IRQn
|
||||
#define CH438_RST_Pin GPIO_PIN_3
|
||||
#define CH438_RST_GPIO_Port GPIOD
|
||||
#define DAC10_CS_Pin GPIO_PIN_6
|
||||
|
|
|
@ -52,10 +52,7 @@ void MemManage_Handler(void);
|
|||
void BusFault_Handler(void);
|
||||
void UsageFault_Handler(void);
|
||||
void DebugMon_Handler(void);
|
||||
void EXTI2_IRQHandler(void);
|
||||
void TIM3_IRQHandler(void);
|
||||
void TIM4_IRQHandler(void);
|
||||
void EXTI15_10_IRQHandler(void);
|
||||
void ETH_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
|
|
|
@ -34,14 +34,11 @@ extern "C" {
|
|||
|
||||
extern TIM_HandleTypeDef htim2;
|
||||
|
||||
extern TIM_HandleTypeDef htim3;
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
void MX_TIM2_Init(void);
|
||||
void MX_TIM3_Init(void);
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
|
|
|
@ -91,7 +91,8 @@ void vApplicationGetIdleTaskMemory(StaticTask_t **ppxIdleTaskTCBBuffer, StackTyp
|
|||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void MX_FREERTOS_Init(void) {
|
||||
void MX_FREERTOS_Init(void)
|
||||
{
|
||||
/* USER CODE BEGIN Init */
|
||||
|
||||
/* USER CODE END Init */
|
||||
|
@ -128,7 +129,6 @@ void MX_FREERTOS_Init(void) {
|
|||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
/* USER CODE END RTOS_THREADS */
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN Header_start_lwip_task */
|
||||
|
@ -154,7 +154,7 @@ void start_lwip_task(void const * argument)
|
|||
{
|
||||
if (tcp_echo_flags[tcp_hart_num] == 1)
|
||||
{
|
||||
if (((phyreg >> 2) & 0x1) != 0x1) // PHY_BSR寄存器的<E599A8><EFBFBD>??2位表示PHY是否连接 PHY_LINKED_STATUS
|
||||
if (((phyreg >> 2) & 0x1) != 0x1) // PHY_BSR寄存器的<E599A8>??2位表示PHY是否连接 PHY_LINKED_STATUS
|
||||
{
|
||||
/* When the netif link is down this function must be called */
|
||||
|
||||
|
@ -216,6 +216,8 @@ void start_ch438_task(void const * argument)
|
|||
for (;;)
|
||||
{
|
||||
// osThreadTerminate(NULL);
|
||||
ch438_interrupt_handler_ch438_chip_1();
|
||||
ch438_interrupt_handler_ch438_chip_2();
|
||||
ch438_interrupt_handler_data_ch438_chip_1();
|
||||
ch438_interrupt_handler_data_ch438_chip_2();
|
||||
vTaskDelay(10);
|
||||
|
|
|
@ -161,13 +161,6 @@ void MX_GPIO_Init(void)
|
|||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
HAL_GPIO_Init(CH438_1_INT_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/* EXTI interrupt init*/
|
||||
HAL_NVIC_SetPriority(EXTI2_IRQn, 1, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI2_IRQn);
|
||||
|
||||
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 1, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
|
|
@ -95,11 +95,9 @@ int main(void)
|
|||
MX_TIM2_Init();
|
||||
MX_SPI1_Init();
|
||||
MX_FSMC_Init();
|
||||
MX_TIM3_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
hart_ht1200m_reset(); // 初始化HT1200M模块
|
||||
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); // PWM输出,用于驱动HT1200M模块
|
||||
HAL_TIM_Base_Start_IT(&htim3); // <20>臬𢆡TIM3摰𡁏𧒄<F0A1818F>剁<EFBFBD><E58981>其<EFBFBD>憭<EFBFBD><E686AD>CH438銝剜鱏
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Call init function for freertos objects (in freertos.c) */
|
||||
|
@ -152,8 +150,7 @@ void SystemClock_Config(void)
|
|||
|
||||
/** Initializes the CPU, AHB and APB buses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
||||
|
@ -166,19 +163,19 @@ void SystemClock_Config(void)
|
|||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
||||
{
|
||||
if (CH438_1_INT_Pin == GPIO_Pin)
|
||||
{
|
||||
ch438_1_int_flag = 1; // 霈曄蔭CH438_1<5F><31>葉<EFBFBD>剜<EFBFBD>敹梹<E695B9><E6A2B9>其<EFBFBD>銝剜鱏憭<E9B18F><E686AD><EFBFBD>賣㺭銝剖ế<E58996>剜糓<E5899C>虫蛹CH438_1<5F><31>葉<EFBFBD>剛窈嚙???
|
||||
// ch438_interrupt_handler_ch438_chip_1();
|
||||
}
|
||||
if (CH438_2_INT_Pin == GPIO_Pin)
|
||||
{
|
||||
ch438_2_int_flag = 1; // 霈曄蔭CH438_1<5F><31>葉<EFBFBD>剜<EFBFBD>敹梹<E695B9><E6A2B9>其<EFBFBD>銝剜鱏憭<E9B18F><E686AD><EFBFBD>賣㺭銝剖ế<E58996>剜糓<E5899C>虫蛹CH438_2<5F><32>葉<EFBFBD>剛窈嚙???
|
||||
// ch438_interrupt_handler_ch438_chip_2();
|
||||
}
|
||||
}
|
||||
// void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
||||
// {
|
||||
// if (CH438_1_INT_Pin == GPIO_Pin)
|
||||
// {
|
||||
// ch438_1_int_flag = 1; // 设置CH438_1的中断标志,用于中断处理函数中判断是否为CH438_1的中断请<E696AD>???
|
||||
// // ch438_interrupt_handler_ch438_chip_1();
|
||||
// }
|
||||
// if (CH438_2_INT_Pin == GPIO_Pin)
|
||||
// {
|
||||
// ch438_2_int_flag = 1; // 设置CH438_1的中断标志,用于中断处理函数中判断是否为CH438_2的中断请<E696AD>???
|
||||
// // ch438_interrupt_handler_ch438_chip_2();
|
||||
// }
|
||||
// }
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
|
@ -194,32 +191,33 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
|||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM4) {
|
||||
if (htim->Instance == TIM4)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
if (htim->Instance == TIM3)
|
||||
{
|
||||
if (ch438_1_int_flag == 2)
|
||||
{
|
||||
ch438_interrupt_handler_ch438_chip_1();
|
||||
ch438_1_int_flag = 0;
|
||||
}
|
||||
if (ch438_1_int_flag == 1)
|
||||
{
|
||||
ch438_1_int_flag++;
|
||||
}
|
||||
// if (htim->Instance == TIM3)
|
||||
// {
|
||||
// if (ch438_1_int_flag == 2)
|
||||
// {
|
||||
// ch438_interrupt_handler_ch438_chip_1();
|
||||
// ch438_1_int_flag = 0;
|
||||
// }
|
||||
// if (ch438_1_int_flag == 1)
|
||||
// {
|
||||
// ch438_1_int_flag++;
|
||||
// }
|
||||
|
||||
if (ch438_2_int_flag == 2)
|
||||
{
|
||||
ch438_interrupt_handler_ch438_chip_2();
|
||||
ch438_2_int_flag = 0;
|
||||
}
|
||||
if (ch438_2_int_flag == 1)
|
||||
{
|
||||
ch438_2_int_flag++;
|
||||
}
|
||||
}
|
||||
// if (ch438_2_int_flag == 2)
|
||||
// {
|
||||
// ch438_interrupt_handler_ch438_chip_2();
|
||||
// ch438_2_int_flag = 0;
|
||||
// }
|
||||
// if (ch438_2_int_flag == 1)
|
||||
// {
|
||||
// ch438_2_int_flag++;
|
||||
// }
|
||||
// }
|
||||
/* USER CODE END Callback 1 */
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern ETH_HandleTypeDef heth;
|
||||
extern TIM_HandleTypeDef htim3;
|
||||
extern TIM_HandleTypeDef htim4;
|
||||
|
||||
/* USER CODE BEGIN EV */
|
||||
|
@ -162,34 +161,6 @@ void DebugMon_Handler(void)
|
|||
/* please refer to the startup file (startup_stm32f4xx.s). */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line2 interrupt.
|
||||
*/
|
||||
void EXTI2_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI2_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI2_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(CH438_1_INT_Pin);
|
||||
/* USER CODE BEGIN EXTI2_IRQn 1 */
|
||||
// ch438_interrupt_handler();
|
||||
/* USER CODE END EXTI2_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM3 global interrupt.
|
||||
*/
|
||||
void TIM3_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_IRQn 0 */
|
||||
|
||||
/* USER CODE END TIM3_IRQn 0 */
|
||||
HAL_TIM_IRQHandler(&htim3);
|
||||
/* USER CODE BEGIN TIM3_IRQn 1 */
|
||||
|
||||
/* USER CODE END TIM3_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM4 global interrupt.
|
||||
*/
|
||||
|
@ -204,20 +175,6 @@ void TIM4_IRQHandler(void)
|
|||
/* USER CODE END TIM4_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line[15:10] interrupts.
|
||||
*/
|
||||
void EXTI15_10_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI15_10_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(CH438_2_INT_Pin);
|
||||
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI15_10_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Ethernet global interrupt.
|
||||
*/
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
/* USER CODE END 0 */
|
||||
|
||||
TIM_HandleTypeDef htim2;
|
||||
TIM_HandleTypeDef htim3;
|
||||
|
||||
/* TIM2 init function */
|
||||
void MX_TIM2_Init(void)
|
||||
|
@ -70,46 +69,6 @@ void MX_TIM2_Init(void)
|
|||
/* USER CODE END TIM2_Init 2 */
|
||||
HAL_TIM_MspPostInit(&htim2);
|
||||
|
||||
}
|
||||
/* TIM3 init function */
|
||||
void MX_TIM3_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM3_Init 0 */
|
||||
|
||||
/* USER CODE END TIM3_Init 0 */
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM3_Init 1 */
|
||||
|
||||
/* USER CODE END TIM3_Init 1 */
|
||||
htim3.Instance = TIM3;
|
||||
htim3.Init.Prescaler = 54;
|
||||
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim3.Init.Period = 499;
|
||||
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
|
||||
if (HAL_TIM_Base_Init(&htim3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim3, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM3_Init 2 */
|
||||
|
||||
/* USER CODE END TIM3_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* tim_pwmHandle)
|
||||
|
@ -127,26 +86,6 @@ void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* tim_pwmHandle)
|
|||
/* USER CODE END TIM2_MspInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
{
|
||||
|
||||
if(tim_baseHandle->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 0 */
|
||||
/* TIM3 clock enable */
|
||||
__HAL_RCC_TIM3_CLK_ENABLE();
|
||||
|
||||
/* TIM3 interrupt Init */
|
||||
HAL_NVIC_SetPriority(TIM3_IRQn, 5, 0);
|
||||
HAL_NVIC_EnableIRQ(TIM3_IRQn);
|
||||
/* USER CODE BEGIN TIM3_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 1 */
|
||||
}
|
||||
}
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle)
|
||||
{
|
||||
|
||||
|
@ -191,25 +130,6 @@ void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef* tim_pwmHandle)
|
|||
}
|
||||
}
|
||||
|
||||
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
{
|
||||
|
||||
if(tim_baseHandle->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM3_CLK_DISABLE();
|
||||
|
||||
/* TIM3 interrupt Deinit */
|
||||
HAL_NVIC_DisableIRQ(TIM3_IRQn);
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 1 */
|
||||
}
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
|
|
@ -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>6</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>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
|
@ -130,7 +130,7 @@
|
|||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ARMDBGFLAGS</Key>
|
||||
<Name />
|
||||
<Name></Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
|
@ -145,7 +145,7 @@
|
|||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-UB -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407ZGTx$CMSIS\Flash\STM32F4xx_1024.FLM) -WA0 -WE0 -WVCE4 -WS2710 -WM0 -WP2</Name>
|
||||
<Name>-UB -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407ZGTx$CMSIS\Flash\STM32F4xx_1024.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
|
@ -198,7 +198,7 @@
|
|||
<Ww>
|
||||
<count>9</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>hart_uart</ItemText>
|
||||
<ItemText>hart_uart,0x0A</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>10</count>
|
||||
|
@ -285,7 +285,7 @@
|
|||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>0</aLwin>
|
||||
<aLwin>1</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
|
@ -308,19 +308,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>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -262,8 +262,8 @@ void ch438_send_data(uint8_t uart_num, uint8_t *data, uint16_t len)
|
|||
{
|
||||
hart_ht1200m_rts_io_send(uart_num);
|
||||
uint8_t ch438_num = 0;
|
||||
// data[len] = 0xFF; // 因为发送数据RHART的RTS需要延时,这里用多一个字节的发送来代替延时
|
||||
// data[len + 1] = 0xFF; // 因为发送数据RHART的RTS需要延时,这里用多两个字节的发送来代替延时
|
||||
data[len] = 0xFF; // 因为发送数据RHART的RTS需要延时,这里用多一个字节的发送来代替延时
|
||||
data[len + 1] = 0x00; // 因为发送数据RHART的RTS需要延时,这里用多两个字节的发送来代替延时
|
||||
if (uart_num < 8)
|
||||
{
|
||||
ch438_num = CH438_CHIP0;
|
||||
|
@ -274,7 +274,7 @@ void ch438_send_data(uint8_t uart_num, uint8_t *data, uint16_t len)
|
|||
uart_num -= 8;
|
||||
}
|
||||
// ch438_write_reg(ch438_num, offsetadd[uart_num] | REG_THR_ADDR, data[len], 1);
|
||||
for (uint8_t i = 0; i < len; i++)
|
||||
for (uint8_t i = 0; i < len + 2; i++)
|
||||
{
|
||||
ch438_write_reg(ch438_num, offsetadd[uart_num] | REG_THR_ADDR, data[i], 1);
|
||||
}
|
||||
|
@ -450,6 +450,7 @@ void ch438_interrupt_handler_data_ch438_chip_1(void)
|
|||
{
|
||||
|
||||
case INT_RCV_OVERTIME: /* 接收超时中断 */
|
||||
memset(hart_uart[i].rx_data, 0x00, sizeof(hart_uart[i].rx_data));
|
||||
hart_uart[i].rx_length = ch438_recv_data(i, hart_uart[i].rx_data);
|
||||
if (tcp_echo_flags[i] == 1)
|
||||
{
|
||||
|
@ -458,6 +459,7 @@ void ch438_interrupt_handler_data_ch438_chip_1(void)
|
|||
}
|
||||
break;
|
||||
case INT_RCV_SUCCESS: /* 接收数据可用中断 */
|
||||
memset(hart_uart[i].rx_data, 0x00, sizeof(hart_uart[i].rx_data));
|
||||
hart_uart[i].rx_length = ch438_recv_data(i, hart_uart[i].rx_data);
|
||||
if (tcp_echo_flags[i] == 1)
|
||||
{
|
||||
|
@ -488,6 +490,7 @@ void ch438_interrupt_handler_data_ch438_chip_2(void)
|
|||
|
||||
for (i = 8; i < 16; i++)
|
||||
{
|
||||
|
||||
if (gInterruptStatus & Interruptnum[i - 8]) /* 检测哪个串口发生中断 */
|
||||
{
|
||||
InterruptStatus = ch438_read_reg(ch438_num, offsetadd[i - 8] | REG_IIR_ADDR, 1) & 0x0f; /* 读串口的中断状态 */
|
||||
|
@ -496,6 +499,7 @@ void ch438_interrupt_handler_data_ch438_chip_2(void)
|
|||
{
|
||||
|
||||
case INT_RCV_OVERTIME: /* 接收超时中断 */
|
||||
memset(hart_uart[i].rx_data, 0x00, sizeof(hart_uart[i].rx_data));
|
||||
hart_uart[i].rx_length = ch438_recv_data(i, hart_uart[i].rx_data);
|
||||
if (tcp_echo_flags[i] == 1)
|
||||
{
|
||||
|
@ -504,6 +508,7 @@ void ch438_interrupt_handler_data_ch438_chip_2(void)
|
|||
}
|
||||
break;
|
||||
case INT_RCV_SUCCESS: /* 接收数据可用中断 */
|
||||
memset(hart_uart[i].rx_data, 0x00, sizeof(hart_uart[i].rx_data));
|
||||
hart_uart[i].rx_length = ch438_recv_data(i, hart_uart[i].rx_data);
|
||||
if (tcp_echo_flags[i] == 1)
|
||||
{
|
||||
|
|
|
@ -67,8 +67,7 @@ Mcu.IP5=RCC
|
|||
Mcu.IP6=SPI1
|
||||
Mcu.IP7=SYS
|
||||
Mcu.IP8=TIM2
|
||||
Mcu.IP9=TIM3
|
||||
Mcu.IPNb=10
|
||||
Mcu.IPNb=9
|
||||
Mcu.Name=STM32F407Z(E-G)Tx
|
||||
Mcu.Package=LQFP144
|
||||
Mcu.Pin0=PE2
|
||||
|
@ -146,10 +145,9 @@ Mcu.Pin73=PE1
|
|||
Mcu.Pin74=VP_FREERTOS_VS_CMSIS_V1
|
||||
Mcu.Pin75=VP_LWIP_VS_Enabled
|
||||
Mcu.Pin76=VP_SYS_VS_tim4
|
||||
Mcu.Pin77=VP_TIM3_VS_ClockSourceINT
|
||||
Mcu.Pin8=PF4
|
||||
Mcu.Pin9=PF5
|
||||
Mcu.PinsNb=78
|
||||
Mcu.PinsNb=77
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F407ZGTx
|
||||
|
@ -158,8 +156,6 @@ MxDb.Version=DB.6.0.92
|
|||
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
|
||||
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
|
||||
NVIC.ETH_IRQn=true\:6\:0\:true\:false\:true\:true\:false\:true\:true
|
||||
NVIC.EXTI15_10_IRQn=true\:1\:0\:true\:false\:true\:false\:true\:true\:true
|
||||
NVIC.EXTI2_IRQn=true\:1\:0\:true\:false\:true\:false\:true\:true\:true
|
||||
NVIC.ForceEnableDMAVector=true
|
||||
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
|
||||
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
|
||||
|
@ -171,7 +167,6 @@ NVIC.SavedPendsvIrqHandlerGenerated=true
|
|||
NVIC.SavedSvcallIrqHandlerGenerated=true
|
||||
NVIC.SavedSystickIrqHandlerGenerated=true
|
||||
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true\:false
|
||||
NVIC.TIM3_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
|
||||
NVIC.TIM4_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
|
||||
NVIC.TimeBase=TIM4_IRQn
|
||||
NVIC.TimeBaseIP=TIM4
|
||||
|
@ -632,17 +627,11 @@ TIM2.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
|
|||
TIM2.IPParameters=Channel-PWM Generation4 CH4,Period,Pulse-PWM Generation4 CH4
|
||||
TIM2.Period=119
|
||||
TIM2.Pulse-PWM\ Generation4\ CH4=60
|
||||
TIM3.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
|
||||
TIM3.IPParameters=Prescaler,Period,AutoReloadPreload
|
||||
TIM3.Period=499
|
||||
TIM3.Prescaler=54
|
||||
VP_FREERTOS_VS_CMSIS_V1.Mode=CMSIS_V1
|
||||
VP_FREERTOS_VS_CMSIS_V1.Signal=FREERTOS_VS_CMSIS_V1
|
||||
VP_LWIP_VS_Enabled.Mode=Enabled
|
||||
VP_LWIP_VS_Enabled.Signal=LWIP_VS_Enabled
|
||||
VP_SYS_VS_tim4.Mode=TIM4
|
||||
VP_SYS_VS_tim4.Signal=SYS_VS_tim4
|
||||
VP_TIM3_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
|
||||
board=custom
|
||||
rtos.0.ip=FREERTOS
|
||||
|
|
Loading…
Reference in New Issue