first test for K15
This commit is contained in:
@@ -131,6 +131,23 @@ int main(void)
|
||||
/* USER CODE BEGIN 2 */
|
||||
ULOG_INIT();
|
||||
ULOG_SUBSCRIBE(ULOG_SendLPUART,ULOG_DEBUG_LEVEL);
|
||||
GPIO_PinState K15 = HAL_GPIO_ReadPin(K15_Detect_GPIO_Port, K15_Detect_Pin);
|
||||
while (K15 == GPIO_PIN_RESET)
|
||||
{
|
||||
K15 = HAL_GPIO_ReadPin(K15_Detect_GPIO_Port, K15_Detect_Pin);
|
||||
ULOG_DEBUG("Wait for K15 Signal Wait Wait Wait");
|
||||
HAL_Delay(100);
|
||||
}
|
||||
|
||||
|
||||
GPIO_PinState HL = HAL_GPIO_ReadPin(Headlight_Detect_GPIO_Port, Headlight_Detect_Pin);
|
||||
while (HL == GPIO_PIN_RESET)
|
||||
{
|
||||
HL = HAL_GPIO_ReadPin(Headlight_Detect_GPIO_Port, Headlight_Detect_Pin);
|
||||
ULOG_DEBUG("Wait for K15 Signal Wait Wait Wait");
|
||||
HAL_Delay(100);
|
||||
}
|
||||
|
||||
ULOG_DEBUG("Setup Logger");
|
||||
HAL_GPIO_WritePin(Periph_Power_GPIO_Port,Periph_Power_Pin,GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(CLS_POWER_GPIO_Port, CLS_POWER_Pin, GPIO_PIN_SET);
|
||||
@@ -138,8 +155,14 @@ int main(void)
|
||||
gCLS_DEVICE_ADDRESS = 0x11;
|
||||
ULOG_DEBUG("Setting Global CLS address to 0b10001");
|
||||
ULOG_DEBUG("Init Kernel and start schedule");
|
||||
|
||||
|
||||
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
||||
|
||||
|
||||
/* Init scheduler */
|
||||
osKernelInitialize(); /* Call init function for freertos objects (in freertos.c) */
|
||||
MX_FREERTOS_Init();
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "AsyncComm.h"
|
||||
|
||||
#include "string.h"
|
||||
|
||||
#include "stm32h7xx_ll_dma.h"
|
||||
#include "stm32h7xx_ll_usart.h"
|
||||
|
||||
@@ -210,7 +212,7 @@ void usart_send_data(const uart_desc_t* uart, const void* data, size_t len) {
|
||||
* \param[in] str: String to send
|
||||
*/
|
||||
void usart_send_string(const uart_desc_t* uart, const char* str) {
|
||||
lwrb_write(&uart->data->tx_rb, str, strnlen(str, 255)); /* Write data to TX buffer for loopback */
|
||||
lwrb_write(&uart->data->tx_rb, str, strlen(str)); /* Write data to TX buffer for loopback */
|
||||
usart_start_tx_dma_transfer(uart); /* Then try to start transfer */
|
||||
}
|
||||
|
||||
|
||||
BIN
pinout.png
Normal file
BIN
pinout.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 293 KiB |
Reference in New Issue
Block a user