1、updata lora_radio_driver submodules;2、fix radio define error in connect_lora_spi.c;3、fix ticks calculation bug in timer_settime。

This commit is contained in:
Liu_Weichao 2023-03-21 15:16:12 +08:00
parent 0a71b8b62a
commit 08388f1b11
5 changed files with 8 additions and 7 deletions

View File

@ -107,12 +107,13 @@ int timer_settime(timer_t timerid, int flags, const struct itimerspec *restrict
//reference from RTT
/* calculate timer period(tick); To avoid lost of accuracy, because "TICK_PER_SECOND" maybe 100, 1000, 1024 and so on.
*
* tick nanosecond nanosecond * TICK_PER_SECOND
* tick millisecond millisecond * TICK_PER_SECOND
* ------------------------- = -------------------------- ---> tick = -------------------------------------
* TICK_PER_SECOND NANOSECOND_PER_SECOND NANOSECOND_PER_SECOND
* TICK_PER_SECOND MILLISECOND_PER_SECOND MILLISECOND_PER_SECOND
*
*/
uint32_t ticks = (value->it_interval.tv_sec * TICK_PER_SECOND) + (value->it_interval.tv_nsec / 1000000000) * TICK_PER_SECOND;
uint32_t ms_value = value->it_interval.tv_nsec / 1000000;
uint32_t ticks = (value->it_interval.tv_sec * TICK_PER_SECOND) + (ms_value * TICK_PER_SECOND) / 1000;
UserTimerModify(timerid, ticks);

@ -1 +1 @@
Subproject commit a400879b133bdce5051f7a550a4a05bfdbceb26c
Subproject commit be37aa885ca710ddcdf6ec0f671f0d566da9cb6f

View File

@ -22,7 +22,7 @@
static struct HardwareDev *g_spi_lora_dev;
static BusType buspin;
tRadioDriver *Radio = NONE;
static tRadioDriver *Radio = NONE;
void SX1276InitIo(void)
{
struct PinParam PinCfg;

View File

@ -22,7 +22,7 @@
static struct HardwareDev *g_spi_lora_dev;
static BusType buspin;
tRadioDriver *Radio = NONE;
static tRadioDriver *Radio = NONE;
void SX1276InitIo(void)
{
struct PinParam PinCfg;

View File

@ -25,7 +25,7 @@
#define LORA_RST_PIN (GPIO_PIN_02)
static struct HardwareDev *g_spi_lora_dev;
tRadioDriver *Radio = NONE;
static tRadioDriver *Radio = NONE;
void SX1276InitIo(void)
{