comparison Small_CPU/Src/baseCPU2.c @ 704:f1b40364b0af

Added protocol functions for UART DiveO2 sensor: The code has been modified to support the handling of several protocols (including baud rate changes). The data is requested by polling and passed via DMA into a ringbuffer which is then parsed by a cyclic function call in the main loop. At the moment only the O2 values are forwarded but because the sensor send several types of data within a signle message already more is extracted but yet discarded.
author Ideenmodellierer
date Fri, 28 Oct 2022 20:49:21 +0200
parents 49b164022335
children 1fbcca5bdf5d
comparison
equal deleted inserted replaced
703:2f457024049b 704:f1b40364b0af
420 GPIO_Power_MainCPU_ON(); 420 GPIO_Power_MainCPU_ON();
421 } 421 }
422 SPI_synchronize_with_Master(); 422 SPI_synchronize_with_Master();
423 MX_DMA_Init(); 423 MX_DMA_Init();
424 MX_SPI1_Init(); 424 MX_SPI1_Init();
425 MX_USART1_UART_Init(); 425 externalInterface_SwitchUART(externalInterface_GetUARTProtocol());
426 SPI_Start_single_TxRx_with_Master(); /* be prepared for the first data exchange */ 426 SPI_Start_single_TxRx_with_Master(); /* be prepared for the first data exchange */
427 Scheduler_Request_sync_with_SPI(SPI_SYNC_METHOD_HARD); 427 Scheduler_Request_sync_with_SPI(SPI_SYNC_METHOD_HARD);
428 EXTI_Test_Button_Init(); 428 EXTI_Test_Button_Init();
429 global.mode = MODE_SURFACE; 429 global.mode = MODE_SURFACE;
430 break; 430 break;