加入大疆C板例程bsp

This commit is contained in:
2026-04-12 20:34:47 +08:00
parent 7475077b9e
commit b68ac54a34
51 changed files with 5950 additions and 1290 deletions

21
bsp/boards/bsp_rng.c Normal file
View File

@@ -0,0 +1,21 @@
#include "bsp_rng.h"
#include "main.h"
extern RNG_HandleTypeDef hrng;
uint32_t RNG_get_random_num(void)
{
static uint32_t rng;
HAL_RNG_GenerateRandomNumber(&hrng, &rng);
return rng;
}
int32_t RNG_get_random_rangle(int min, int max)
{
static int32_t random;
random = (RNG_get_random_num() % (max - min + 1)) + min;
return random;
}