1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 11:00:02 +03:00

SITL: Minor changes to simplify platform (#14501)

* SITL: Minor changes to simplify platform

* Update main.c

* Update platform.h

* As per @ledvinap review
This commit is contained in:
Jay Blackman 2025-07-04 15:40:17 +10:00 committed by GitHub
parent 9b4d123db3
commit d1ff01d738
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View file

@ -31,7 +31,7 @@ void run(void);
int main(int argc, char * argv[])
{
#ifdef SIMULATOR_BUILD
#ifdef USE_MAIN_ARGS
targetParseArgs(argc, argv);
#else
UNUSED(argc);
@ -48,8 +48,8 @@ void FAST_CODE run(void)
{
while (true) {
scheduler();
#ifdef SIMULATOR_BUILD
delayMicroseconds_real(50); // max rate 20kHz
#if defined(RUN_LOOP_DELAY_US) && RUN_LOOP_DELAY_US > 0
delayMicroseconds_real(RUN_LOOP_DELAY_US);
#endif
}
}

View file

@ -32,7 +32,7 @@
PG_REGISTER_WITH_RESET_TEMPLATE(gpsConfig_t, gpsConfig, PG_GPS_CONFIG, 4);
PG_RESET_TEMPLATE(gpsConfig_t, gpsConfig,
#if defined(SIMULATOR_BUILD) && defined(USE_VIRTUAL_GPS)
#if defined(USE_VIRTUAL_GPS)
.provider = GPS_VIRTUAL,
#else
.provider = GPS_UBLOX,

View file

@ -35,10 +35,6 @@
#include "drivers/sensor.h"
#include "sensors/gyro.h"
#ifdef SIMULATOR_BUILD
#define GYRO_COUNT 1
#endif
#ifndef GYRO_1_CS_PIN
#define GYRO_1_CS_PIN NONE
#endif

View file

@ -36,4 +36,8 @@
#define I2CDEV_COUNT 0
#define RUN_LOOP_DELAY_US 50 // max 20khz run loop frequency
#define USE_MAIN_ARGS
#define GYRO_COUNT 1 // 1 Gyro
typedef void* ADC_TypeDef; // Dummy definition for ADC_TypeDef