Compare commits
6 Commits
8b8c97316b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d2d9d21f3d | |||
| f53f49a94e | |||
| dce176cc1e | |||
| e351c762d3 | |||
| 89b5fe349c | |||
| 2b445aac84 |
+9
-14
@@ -73,11 +73,15 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
|
|||||||
osMessageQueueId_t queue;
|
osMessageQueueId_t queue;
|
||||||
osThreadId_t led_task;
|
osThreadId_t led_task;
|
||||||
|
|
||||||
// TODO: manage the case of FIFO overflow
|
if (__HAL_CAN_GET_FLAG(hcan, CAN_FLAG_FOV0) != RESET) __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_FOV0);
|
||||||
|
|
||||||
if (HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &rxHeader, data) != HAL_OK) return;
|
if (HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &rxHeader, data) != HAL_OK) return;
|
||||||
|
|
||||||
|
if (rxHeader.DLC > 8) return;
|
||||||
|
|
||||||
if (rxHeader.IDE == CAN_ID_EXT) message.id = rxHeader.ExtId;
|
if (rxHeader.IDE == CAN_ID_EXT) message.id = rxHeader.ExtId;
|
||||||
else message.id = rxHeader.StdId;
|
else message.id = rxHeader.StdId;
|
||||||
|
|
||||||
message.dlc = rxHeader.DLC;
|
message.dlc = rxHeader.DLC;
|
||||||
message.isExtended = (rxHeader.IDE == CAN_ID_EXT);
|
message.isExtended = (rxHeader.IDE == CAN_ID_EXT);
|
||||||
message.source = (hcan->Instance == CAN1) ? 1 : 2;
|
message.source = (hcan->Instance == CAN1) ? 1 : 2;
|
||||||
@@ -119,12 +123,7 @@ void vCANListener(void *argument)
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (osMessageQueueGet(queue, &message, NULL, 1000) == osOK)
|
if (osMessageQueueGet(queue, &message, NULL, 1000) == osOK) osMessageQueuePut(xUARTQueue, &message, 0U, 0U);
|
||||||
{
|
|
||||||
// J1939 decoding
|
|
||||||
|
|
||||||
osMessageQueuePut(xUARTQueue, &message, 0U, 0U);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* END vCANListener */
|
/* END vCANListener */
|
||||||
@@ -141,14 +140,10 @@ void vLEDHeartbeat(void *argument)
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
uint32_t notification = osThreadFlagsWait(0x01, osFlagsWaitAny, osWaitForever);
|
uint32_t notification = osThreadFlagsWait(0x01, osFlagsWaitAny, LED_BLINK_MS);
|
||||||
|
|
||||||
if (notification & 0x01)
|
if (notification & 0x01) HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET);
|
||||||
{
|
else HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
||||||
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET);
|
|
||||||
osDelay(LED_BLINK_MS);
|
|
||||||
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* END vLEDHeartbeat */
|
/* END vLEDHeartbeat */
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
|
||||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
|
||||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
|
||||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{"fItems":[{"fIsFromMainTab":true,"fPath":"Debug/can-logger.elf","fProjectName":"can-logger","fPerformBuild":true,"fDownload":true,"fLoadSymbols":true}]}"/>
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{"fItems":[{"fIsFromMainTab":true,"fPath":"/Users/erickahmed/TESI/j1939-can-logger_NEW/can-logger/can-logger/Debug/can-logger.elf","fProjectName":"can-logger","fPerformBuild":true,"fDownload":true,"fLoadSymbols":true}]}"/>
|
||||||
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.mode" value="0"/>
|
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.mode" value="0"/>
|
||||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.multi_drop_enabled" value="false"/>
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.multi_drop_enabled" value="false"/>
|
||||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
|
||||||
@@ -74,9 +74,9 @@
|
|||||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
|
||||||
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
|
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/can-logger.elf"/>
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="/Users/erickahmed/TESI/j1939-can-logger_NEW/can-logger/can-logger/Debug/can-logger.elf"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="can-logger"/>
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="can-logger"/>
|
||||||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
|
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.642969664"/>
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.642969664"/>
|
||||||
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
|
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
|||||||
Reference in New Issue
Block a user