Added some more comments to Failsafe and CLI
General comments added for the failsafe and toggles. Also added description in CLI.h on the necessary steps to add a new command to the CLI and how to also add the value it should operate on to the EEPROM.
This commit is contained in:
parent
dfac730893
commit
238b71b8bc
@ -55,5 +55,50 @@ bool cliHasMessage();
|
||||
bool cliShouldRun();
|
||||
|
||||
|
||||
|
||||
#endif /* CONFIG_CLI_H_ */
|
||||
|
||||
/* CHECKLIST - How to add new command in CLI */
|
||||
/* A: First add the value that should be changed to the EEPROM
|
||||
*
|
||||
* 1: Create a EEPROM enum id for the value in eeprom.h. Make sure
|
||||
* to place within the correct enum container system or profile.
|
||||
*
|
||||
* 2: In eeprom.c add two values to the correct array for the value
|
||||
* profile or system. THe two values should be the pointer to the
|
||||
* value to store in eeprom and the size of said value.
|
||||
*
|
||||
* 3: Now the value should be storable int the EEPROM.
|
||||
*
|
||||
* B: Create the actual command in the CLI.
|
||||
*
|
||||
* 1: First create an enum id for the CLI command in the command_Ids_t
|
||||
* contained in the cli.c.
|
||||
*
|
||||
* 2: When the id is created it represents an array value in the
|
||||
* commandTable, an array of cliCommandConfig_t.
|
||||
*
|
||||
* 3: Initialize the values of the cliCommandConfig_t for the newly
|
||||
* created command id. Provide in this order:
|
||||
* - The name of the command when typing it in CLI.
|
||||
* - The created Command id.
|
||||
* - The EEPROM id to the value the command shoud operate on.
|
||||
* - The type of EEPROM value syetem, profile, etc...
|
||||
* - The offset of the value at the given eeprom address, usable if
|
||||
* the value stored in the EEPROM is for example a struct and
|
||||
* the value to be accessed is for example 4 bytes from the start
|
||||
* of the struct. In that case this value would be set to 4.
|
||||
* - The type of the value the command should operate on. Uint8,
|
||||
* uint16, uint 32 etc...
|
||||
* - The min and maximum value that can be given using the command.
|
||||
*
|
||||
* C: When both these things have been done the command should have been
|
||||
* added to the CLI and it should operate on the correct value in the
|
||||
* system that is also stored in the EEPROM.
|
||||
*
|
||||
* D: NOTE, be careful when setting up the CLI command, any small mistake
|
||||
* in the command can cause strange errors that can be hard to track
|
||||
* down at a later stage. Therefore make sure that the command works
|
||||
* as intended and double check all the values for the command and see
|
||||
* that they are what they should be.
|
||||
* */
|
||||
|
||||
|
@ -1,9 +1,23 @@
|
||||
/*
|
||||
* failsafe_toggles.h
|
||||
*
|
||||
* Created on: 10 okt. 2016
|
||||
* Author: holmis
|
||||
*/
|
||||
/**********************************************************************
|
||||
* NAME: failsafe_toggles.h *
|
||||
* AUTHOR: Jonas Holmberg *
|
||||
* PURPOSE: Give the ability to create boolean flags and failsafe *
|
||||
* variables. *
|
||||
* INFORMATION: Create any boolean variable that should be able to be *
|
||||
* used throughout the system. These can be boolean vales *
|
||||
* for standard checks, failsafes etc. These can also be *
|
||||
* linked to a RC channel and value range wherein the *
|
||||
* value will be set to one. *
|
||||
* *
|
||||
* GLOBAL VARIABLES: *
|
||||
* Variable Type Description *
|
||||
* -------- ---- ----------- *
|
||||
* systemFlags boolFlags_t Represents a bitfield of all the *
|
||||
* boolean values in the system. *
|
||||
* flagConfigArr flags_Configuration_t Configuration values for any *
|
||||
* flag that should be changeable *
|
||||
* from the RC controller. *
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef DRIVERS_FAILSAFE_TOGGLES_H_
|
||||
#define DRIVERS_FAILSAFE_TOGGLES_H_
|
||||
@ -98,7 +112,7 @@ typedef enum
|
||||
FLAG_CONFIGURATION_COUNT
|
||||
}flags_configuration_IDs_t;
|
||||
|
||||
/* Stuct containing values for all the flags and failsafe booleans sin the system */
|
||||
/* Bitfield containing values for all the flags and failsafe booleans sin the system */
|
||||
extern boolFlags_t systemFlags;
|
||||
|
||||
/* Array of flag configurations. These are values that can be set by RC. */
|
||||
|
@ -1,9 +1,23 @@
|
||||
/*
|
||||
* failsafe_toggles.c
|
||||
*
|
||||
* Created on: 10 okt. 2016
|
||||
* Author: holmis
|
||||
*/
|
||||
/**********************************************************************
|
||||
* NAME: failsafe_toggles.c *
|
||||
* AUTHOR: Jonas Holmberg *
|
||||
* PURPOSE: Give the ability to create boolean flags and failsafe *
|
||||
* variables. *
|
||||
* INFORMATION: Create any boolean variable that should be able to be *
|
||||
* used throughout the system. These can be boolean vales *
|
||||
* for standard checks, failsafes etc. These can also be *
|
||||
* linked to a RC channel and value range wherein the *
|
||||
* value will be set to one. *
|
||||
* *
|
||||
* GLOBAL VARIABLES: *
|
||||
* Variable Type Description *
|
||||
* -------- ---- ----------- *
|
||||
* systemFlags boolFlags_t Represents a bitfield of all the *
|
||||
* boolean values in the system. *
|
||||
* flagConfigArr flags_Configuration_t Configuration values for any *
|
||||
* flag that should be changeable *
|
||||
* from the RC controller. *
|
||||
**********************************************************************/
|
||||
|
||||
#include "drivers/failsafe_toggles.h"
|
||||
#include "drivers/sbus.h"
|
||||
|
Reference in New Issue
Block a user