Working receive and handling of control signals

This commit is contained in:
@CarlWachter
2024-02-22 16:37:05 +01:00
parent 01e03fb667
commit 8367127c62
18 changed files with 278 additions and 111 deletions

View File

@@ -217,7 +217,7 @@ void unpackValues(uint8_t packedByte, uint8_t* type_id, uint8_t* sensor_ID, uint
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan1)
{
HAL_CAN_GetRxMessage(hcan1, CAN_RX_FIFO0, &rxHeader, canRX);
/*HAL_CAN_GetRxMessage(hcan1, CAN_RX_FIFO0, &rxHeader, canRX);
uint8_t type_id, sensor_ID, value, include;
@@ -225,17 +225,38 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan1)
if (type_id == 0 && sensor_ID == 1){
if (value == 0){
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_8, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_8, GPIO_PIN_SET);
}else{
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_8, GPIO_PIN_SET);
}
}
}*/
}
/* USER CODE END 4 */
/**
* @brief Period elapsed callback in non blocking mode
* @note This function is called when TIM1 interrupt took place, inside
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
* a global variable "uwTick" used as application time base.
* @param htim : TIM handle
* @retval None
*/
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
/* USER CODE BEGIN Callback 0 */
/* USER CODE END Callback 0 */
if (htim->Instance == TIM1) {
HAL_IncTick();
}
/* USER CODE BEGIN Callback 1 */
/* USER CODE END Callback 1 */
}
/**
* @brief This function is executed in case of error occurrence.
* @retval None