mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 09:39:33 +00:00
Make util module header instead of .ino-file
This commit is contained in:
parent
08b14d1d76
commit
85172cdcc8
3
.vscode/c_cpp_properties.json
vendored
3
.vscode/c_cpp_properties.json
vendored
@ -28,7 +28,6 @@
|
||||
"${workspaceFolder}/flix/motors.ino",
|
||||
"${workspaceFolder}/flix/rc.ino",
|
||||
"${workspaceFolder}/flix/time.ino",
|
||||
"${workspaceFolder}/flix/util.ino",
|
||||
"${workspaceFolder}/flix/wifi.ino",
|
||||
"${workspaceFolder}/flix/parameters.ino"
|
||||
],
|
||||
@ -76,7 +75,6 @@
|
||||
"${workspaceFolder}/flix/motors.ino",
|
||||
"${workspaceFolder}/flix/rc.ino",
|
||||
"${workspaceFolder}/flix/time.ino",
|
||||
"${workspaceFolder}/flix/util.ino",
|
||||
"${workspaceFolder}/flix/wifi.ino",
|
||||
"${workspaceFolder}/flix/parameters.ino"
|
||||
],
|
||||
@ -124,7 +122,6 @@
|
||||
"${workspaceFolder}/flix/motors.ino",
|
||||
"${workspaceFolder}/flix/rc.ino",
|
||||
"${workspaceFolder}/flix/time.ino",
|
||||
"${workspaceFolder}/flix/util.ino",
|
||||
"${workspaceFolder}/flix/wifi.ino",
|
||||
"${workspaceFolder}/flix/parameters.ino"
|
||||
],
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "quaternion.h"
|
||||
#include "pid.h"
|
||||
#include "lpf.h"
|
||||
#include "util.h"
|
||||
|
||||
#define PITCHRATE_P 0.05
|
||||
#define PITCHRATE_I 0.2
|
||||
|
@ -6,12 +6,12 @@
|
||||
#include "quaternion.h"
|
||||
#include "vector.h"
|
||||
#include "lpf.h"
|
||||
#include "util.h"
|
||||
|
||||
#define WEIGHT_ACC 0.5f
|
||||
#define RATES_LFP_ALPHA 0.2 // cutoff frequency ~ 40 Hz
|
||||
|
||||
LowPassFilter<Vector> ratesFilter(RATES_LFP_ALPHA);
|
||||
extern const float ONE_G;
|
||||
|
||||
void estimate() {
|
||||
applyGyro();
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "vector.h"
|
||||
#include "quaternion.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SERIAL_BAUDRATE 115200
|
||||
#define WIFI_ENABLED 1
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include <SPI.h>
|
||||
#include <MPU9250.h>
|
||||
#include "util.h"
|
||||
|
||||
MPU9250 IMU(SPI);
|
||||
|
||||
@ -12,8 +13,6 @@ Vector accBias;
|
||||
Vector gyroBias;
|
||||
Vector accScale(1, 1, 1);
|
||||
|
||||
extern const float ONE_G;
|
||||
|
||||
void setupIMU() {
|
||||
Serial.println("Setup IMU");
|
||||
bool status = IMU.begin();
|
||||
|
@ -4,6 +4,8 @@
|
||||
// Motors output control using MOSFETs
|
||||
// In case of using ESCs, change PWM_MIN and PWM_MAX definitions to appropriate values in μs
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define MOTOR_0_PIN 12 // rear left
|
||||
#define MOTOR_1_PIN 13 // rear right
|
||||
#define MOTOR_2_PIN 14 // front right
|
||||
|
@ -4,6 +4,7 @@
|
||||
// Work with the RC receiver
|
||||
|
||||
#include <SBUS.h>
|
||||
#include "util.h"
|
||||
|
||||
float channelNeutral[RC_CHANNELS] = {NAN}; // first element NAN means not calibrated
|
||||
float channelMax[RC_CHANNELS];
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
// Utility functions
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <math.h>
|
||||
#include <soc/soc.h>
|
||||
#include <soc/rtc_cntl_reg.h>
|
@ -17,7 +17,6 @@
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "flix.h"
|
||||
#include "util.ino"
|
||||
#include "rc.ino"
|
||||
#include "time.ino"
|
||||
#include "motors.ino"
|
||||
|
@ -1 +1 @@
|
||||
// Dummy file to make it possible to compile simulator with util.ino
|
||||
// Dummy file to make it possible to compile simulator with Flix' util.h
|
||||
|
@ -1,3 +1,3 @@
|
||||
// Dummy file to make it possible to compile simulator with util.ino
|
||||
// Dummy file to make it possible to compile simulator with Flix' util.h
|
||||
|
||||
#define WRITE_PERI_REG(addr, val) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user