add working Ultrasonic tests
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#include "Ultrasonic_Test.h"
|
||||
#include "drvUltrasonic.h"
|
||||
#include "cmsis_os2.h"
|
||||
#include "main.h"
|
||||
|
||||
static const osThreadAttr_t task_attrs = {
|
||||
.stack_size = 256
|
||||
};
|
||||
|
||||
static void Ultrasonic_Test_Task(void *arg)
|
||||
{
|
||||
(void) arg;
|
||||
|
||||
for ( ; ; )
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2, GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3, GPIO_PIN_SET);
|
||||
osDelay(20);
|
||||
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3, GPIO_PIN_RESET);
|
||||
osDelay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void Ultrasonic_Test_Init(void)
|
||||
{
|
||||
(void) drvUltrasonic_Init();
|
||||
|
||||
osThreadNew(Ultrasonic_Test_Task, (void *) 0, &task_attrs);
|
||||
}
|
||||
Reference in New Issue
Block a user