From 81b603951ce745f88b877d4a9f563a76546cd77c Mon Sep 17 00:00:00 2001 From: ConnerMcLaughlin Date: Tue, 13 Oct 2015 17:49:17 -0500 Subject: [PATCH] Added comments in code --- comms.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/comms.h b/comms.h index a9f57fba..c0228ad6 100644 --- a/comms.h +++ b/comms.h @@ -1,29 +1,29 @@ #ifndef COMMS_H #define COMMS_H - +//These are the page numbers that the Tuner Studio serial protocol uses to transverse the different map and config pages. #define veMapPage 1 -#define veSetPage 2 +#define veSetPage 2//Config Page 1 #define ignMapPage 3 -#define ignSetPage 4 +#define ignSetPage 4//Config Page 2 #define afrMapPage 5 -#define afrSetPage 6 -#define iacPage 7 +#define afrSetPage 6//Config Page 3 +#define iacPage 7//Config Page 4 #define boostvvtPage 8 -byte currentPage = 1; +byte currentPage = 1;//Not the same as the speeduino config page numbers boolean isMap = true; -const char pageTitles[] PROGMEM +const char pageTitles[] PROGMEM //This is being stored in the avr flash instead of SRAM which there is not very much of { - "\nVolumetric Efficiancy Map\0" - "\nPage 1 Config\0" - "\nIgnition Map\0" + "\nVolumetric Efficiancy Map\0"//This is an alternative to using a 2D array which would waste space because of the different lengths of the strings + "\nPage 1 Config\0"//The configuration page titles' indexes are found by counting the chars + "\nIgnition Map\0"//The map page titles' indexes are put into a var called currentTitleIndex. That represents the first char of each string. "\nPage 2 Config\0" "\nAir/Fuel Ratio Map\0" "\nPage 3 Config\0" - "\nPage 4 Config" + "\nPage 4 Config"//No need to put a trailing null because it's the last string and the compliler does it for you. }; -void command(); +void command();//This is the heart of the Command Line Interpeter. All that needed to be done was to make it human readable. void sendValues(); void receiveValue(int offset, byte newValue); void saveConfig();