mirror of
https://github.com/okalachev/flix.git
synced 2026-02-16 23:21:31 +00:00
Add console commands to setup wifi. Add a parameter for choosing between STA and AP mode. Add parameters for udp ports. Remove WIFI_ENABLED macro.
46 lines
816 B
C++
46 lines
816 B
C++
// Copyright (c) 2023 Oleg Kalachev <okalachev@gmail.com>
|
|
// Repository: https://github.com/okalachev/flix
|
|
|
|
// Main firmware file
|
|
|
|
#include "vector.h"
|
|
#include "quaternion.h"
|
|
#include "util.h"
|
|
|
|
|
|
extern float t, dt;
|
|
extern float controlRoll, controlPitch, controlYaw, controlThrottle, controlMode;
|
|
extern Vector gyro, acc;
|
|
extern Vector rates;
|
|
extern Quaternion attitude;
|
|
extern bool landed;
|
|
extern float motors[4];
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
print("Initializing flix\n");
|
|
disableBrownOut();
|
|
setupParameters();
|
|
setupLED();
|
|
setupMotors();
|
|
setLED(true);
|
|
setupWiFi();
|
|
setupIMU();
|
|
setupRC();
|
|
setLED(false);
|
|
print("Initializing complete\n");
|
|
}
|
|
|
|
void loop() {
|
|
readIMU();
|
|
step();
|
|
readRC();
|
|
estimate();
|
|
control();
|
|
sendMotors();
|
|
handleInput();
|
|
processMavlink();
|
|
logData();
|
|
syncParameters();
|
|
}
|