mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-12 19:10:32 +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:
parent
9b4d123db3
commit
d1ff01d738
4 changed files with 8 additions and 8 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue