09_FreeRTOS_CAN_loopback/main.cpp
/**
 * CAN message sender task.
 * Periodically creates CAN message and send them through queue to
 * CAN transmit task.
 * @param pvParameters None
 */
CAN message sender task.
Periodically creates CAN message and send them through queue to
CAN transmit task.
@param pvParameters None
CAN message sender task . Periodically creates CAN message and send them through queue to CAN transmit task . @param pvParameters None
void MessageSenderTask(void *pvParameters) {
  (void)pvParameters;
  CAN_Tx_t can_tx;    
  uint8_t data = 0u;  
  while (1u) {
    memset(&can_tx, 0u, sizeof(can_tx));
    can_tx.DLC |= MESSAGE_DATA_LENGTH;
    can_tx.Data[0] |= data++;
    xQueueSend(CanTxQueue, &can_tx, 0u);
    ToggleRedLed();
    vTaskDelay(TRANSMISSION_DELAY);
  }
}
void MessageSenderTask ( void * pvParameters ) { ( void ) pvParameters ; CAN_Tx_t can_tx ; uint8_t data = 0u ; while ( 1u ) { memset ( & can_tx , 0u , sizeof ( can_tx ) ) ; can_tx . DLC |= MESSAGE_DATA_LENGTH ; can_tx . Data [ 0 ] |= data ++ ; xQueueSend ( CanTxQueue , & can_tx , 0u ) ; ToggleRedLed ( ) ; vTaskDelay ( TRANSMISSION_DELAY ) ; } }
CAN message sender task.
CAN message sender task .
/* CAN message to send */ /* Value to send */ /* Fill CAN message */ /* Send CAN message through queue to CAN transmit task */ /* Indicate message sending */ /* Delay to next message */