/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see .
*/
#pragma once
#include
#include
#include "pg/pg.h"
#define MAX_NAME_LENGTH 16u
#define MAX_PROFILE_NAME_LENGTH 8u
typedef struct pilotConfig_s {
char name[MAX_NAME_LENGTH + 1];
char displayName[MAX_NAME_LENGTH + 1];
} pilotConfig_t;
PG_DECLARE(pilotConfig_t, pilotConfig);
typedef struct systemConfig_s {
uint8_t pidProfileIndex;
uint8_t activeRateProfile;
uint8_t debug_mode;
uint8_t task_statistics;
uint8_t rateProfile6PosSwitch;
uint8_t cpu_overclock;
uint8_t powerOnArmingGraceTime; // in seconds
char boardIdentifier[sizeof(TARGET_BOARD_IDENTIFIER) + 1];
uint8_t hseMhz; // Not used for non-F4 targets
uint8_t configured;
uint8_t schedulerOptimizeRate;
} systemConfig_t;
PG_DECLARE(systemConfig_t, systemConfig);
struct pidProfile_s;
extern struct pidProfile_s *currentPidProfile;
void initEEPROM(void);
void resetEEPROM(void);
bool readEEPROM(void);
void writeEEPROM(void);
void writeEEPROMWithFeatures(uint32_t features);
void ensureEEPROMStructureIsValid(void);
void saveConfigAndNotify(void);
void validateAndFixGyroConfig(void);
void setConfigDirty(void);
bool isConfigDirty(void);
uint8_t getCurrentPidProfileIndex(void);
void changePidProfile(uint8_t pidProfileIndex);
void changePidProfileFromCellCount(uint8_t cellCount);
struct pidProfile_s;
void resetPidProfile(struct pidProfile_s *profile);
uint8_t getCurrentControlRateProfileIndex(void);
void changeControlRateProfile(uint8_t profileIndex);
bool canSoftwareSerialBeUsed(void);
uint16_t getCurrentMinthrottle(void);
void resetConfigs(void);
void targetConfiguration(void);
void targetValidateConfiguration(void);
bool isSystemConfigured(void);