Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
added feature #15 and small bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
SAMUD committed Jan 21, 2017
1 parent 32b69e0 commit caecc15
Show file tree
Hide file tree
Showing 13 changed files with 3,001 additions and 2,911 deletions.
Binary file modified KISS_OSD/.vs/KISS_OSD/v14/.suo
Binary file not shown.
Binary file modified KISS_OSD/Debug/KISS_OSD.cpp.o
Binary file not shown.
Binary file modified KISS_OSD/Debug/KISS_OSD.elf
Binary file not shown.
2,915 changes: 1,473 additions & 1,442 deletions KISS_OSD/Debug/KISS_OSD.hex

Large diffs are not rendered by default.

Binary file modified KISS_OSD/Debug/KISS_OSD.ino.elf
Binary file not shown.
2,915 changes: 1,473 additions & 1,442 deletions KISS_OSD/Debug/KISS_OSD.ino.hex

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions KISS_OSD/Debug/board.buildinfo
Original file line number Diff line number Diff line change
Expand Up @@ -143,31 +143,31 @@ vm.last.preproc.file.0.lineend=163
vm.last.preproc.file.0.prefix_lines=0
vm.last.preproc.file.1.file=EEPROM_Handling.ino
vm.last.preproc.file.1.offset=164
vm.last.preproc.file.1.length=2974
vm.last.preproc.file.1.linecount=92
vm.last.preproc.file.1.length=3021
vm.last.preproc.file.1.linecount=94
vm.last.preproc.file.1.linestart=163
vm.last.preproc.file.1.lineend=255
vm.last.preproc.file.1.lineend=257
vm.last.preproc.file.1.prefix_lines=0
vm.last.preproc.file.2.file=Functions_algo.ino
vm.last.preproc.file.2.offset=256
vm.last.preproc.file.2.length=20455
vm.last.preproc.file.2.linecount=641
vm.last.preproc.file.2.linestart=255
vm.last.preproc.file.2.lineend=896
vm.last.preproc.file.2.offset=258
vm.last.preproc.file.2.length=20829
vm.last.preproc.file.2.linecount=652
vm.last.preproc.file.2.linestart=257
vm.last.preproc.file.2.lineend=909
vm.last.preproc.file.2.prefix_lines=0
vm.last.preproc.file.3.file=GlobalVar.h
vm.last.preproc.file.3.offset=0
vm.last.preproc.file.3.length=5836
vm.last.preproc.file.3.linecount=196
vm.last.preproc.file.3.linestart=896
vm.last.preproc.file.3.lineend=1092
vm.last.preproc.file.3.length=5954
vm.last.preproc.file.3.linecount=200
vm.last.preproc.file.3.linestart=909
vm.last.preproc.file.3.lineend=1109
vm.last.preproc.file.3.prefix_lines=0
vm.last.preproc.file.4.file=Menue.ino
vm.last.preproc.file.4.offset=897
vm.last.preproc.file.4.length=16344
vm.last.preproc.file.4.linecount=659
vm.last.preproc.file.4.linestart=1092
vm.last.preproc.file.4.lineend=1751
vm.last.preproc.file.4.offset=910
vm.last.preproc.file.4.length=16725
vm.last.preproc.file.4.linecount=670
vm.last.preproc.file.4.linestart=1109
vm.last.preproc.file.4.lineend=1779
vm.last.preproc.file.4.prefix_lines=0
compiler.path=C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\
sketch_path=C:\Users\sdaur\Documents\GitHub\KISS-OSD\KISS_OSD
Expand All @@ -178,7 +178,7 @@ runtime.vm.ide.platforms.path=C:\Program Files (x86)\Microsoft Visual Studio 14.
build.variant.path=C:\Program Files (x86)\Arduino\hardware\arduino\variants\eightanaloginputs
archive_file=core.a
archive_file_path=D:\Win10\Temp\VMBuilds\KISS_OSD\nano328\core.a
extra.time.local=60319698
extra.time.local=48798792
vm_all_includes= -I"C:\Program Files (x86)\Arduino\libraries\EEPROMEx" -I"C:\Program Files (x86)\Arduino\libraries\MAX7456" -I"C:\Program Files (x86)\Arduino\libraries\SPI" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\libraries" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\bcmk3pdw.ga2\Micro Platforms\default\debuggers" -I"C:\Users\sdaur\Documents\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\variants\eightanaloginputs"
vm_core_includes= -I"C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\variants\eightanaloginputs"
includes= -I"C:\Program Files (x86)\Arduino\libraries\EEPROMEx" -I"C:\Program Files (x86)\Arduino\libraries\MAX7456" -I"C:\Program Files (x86)\Arduino\libraries\SPI" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\libraries" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\bcmk3pdw.ga2\Micro Platforms\default\debuggers" -I"C:\Users\sdaur\Documents\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\variants\eightanaloginputs"
Expand Down
Binary file modified KISS_OSD/Debug/core.a
Binary file not shown.
2 changes: 2 additions & 0 deletions KISS_OSD/EEPROM_Handling.ino
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ void EEPROMsaveDefaultValues()
Settings.OffsetX = DOffsetX;
Settings.OffsetY = DOffsetY;

Settings.StandbyCurrent = DStandbyCurrent;

Settings.stockSettings = 0;

EEPROMsave();
Expand Down
15 changes: 13 additions & 2 deletions KISS_OSD/Functions_algo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ void getSerialData()
//aquire serial data and write it to normal variables
while (recBytes < minBytes && micros() - LastLoopTime < 20000)
{
#define STARTCOUNT 2


#define STARTCOUNT 2
while (Serial.available()) serialBuf[recBytes++] = Serial.read();
if (recBytes == 1 && serialBuf[0] != 5)recBytes = 0; // check for start byte, reset if its wrong
if (recBytes == 2) minBytes = serialBuf[1] + STARTCOUNT + 1; // got the transmission length
Expand Down Expand Up @@ -169,8 +171,16 @@ void getSerialData()
if (voltDev != 0)
LipoVoltage = (tmpVoltage / voltDev);
LipoVoltage = LipoVoltage + Settings.VoltageOffset;

//capacity

//Settings.StandbyCurrent is @5V so Settings.StandbyCurrent*5V=mW
//mW/CurrentVoltage=Current at actual Voltage
standbyCurrentTotal += (((Settings.StandbyCurrent * 5) / LipoVoltage) / 36000000.0) * (2*(micros() - LastLoopTime));


LipoMAH = ((serialBuf[148 + STARTCOUNT] << 8) | serialBuf[149 + STARTCOUNT]);
LipoMAH += standbyCurrentTotal;
//read Motor Current and other ESC datas
static uint32_t windedupfilterdatas[8];
//RPM
Expand Down Expand Up @@ -208,6 +218,7 @@ void getSerialData()
StickChanVals[3] = ((serialBuf[6 + STARTCOUNT] << 8) | serialBuf[7 + STARTCOUNT]);
//total current
current = (uint16_t)(motorCurrent[0] + motorCurrent[1] + motorCurrent[2] + motorCurrent[3]) / 10;
current += (((Settings.StandbyCurrent * 5) / LipoVoltage) / 100 );
}
}
} //end of aquiring telemetry data
Expand Down Expand Up @@ -320,7 +331,7 @@ void DisplayOSD()
{
OSD.setCursor(4, MarginMiddleY);
MarginMiddleY++;
OSD.print(F(" CAPACITY "));
OSD.print(F(" CAPACITY "));
}
}
OSD.setCursor(-(lipoMAHPos + 1 + Settings.marginLastRow), -1);
Expand Down
6 changes: 5 additions & 1 deletion KISS_OSD/GlobalVar.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
//stock offset //*
#define DOffsetX 0 //*
#define DOffsetY 0 //*
//*
//stock current //*
#define DStandbyCurrent 1000 //*
//*************************************************


Expand Down Expand Up @@ -143,6 +144,8 @@ static uint8_t CurrentPos;
static int configAdress = 0;
static bool memValid = true;

static float standbyCurrentTotal = 0;

struct StoreStruct {

uint16_t LowVoltage1st; //
Expand Down Expand Up @@ -191,6 +194,7 @@ struct StoreStruct {
uint8_t stockSettings;
int8_t OffsetY;
int8_t OffsetX;
uint16_t StandbyCurrent;
};

static StoreStruct Settings;
2 changes: 1 addition & 1 deletion KISS_OSD/KISS_OSD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ by Samuel Daurat ([email protected])
based on the code by Felix Niessen ([email protected])
*/
# define OSDVersion "5.3.3"
#define DMemoryVersion 5
#define DMemoryVersion 6
/*
*****************************************************************************************************
If you like my work and want to support me, I would love to get some support: https://paypal.me/SamuelDaurat
Expand Down
21 changes: 16 additions & 5 deletions KISS_OSD/Menue.ino
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,15 @@ void menuprintsite() {
OSD.print(F("1ST WARN AT % USED:"));
OSD.setCursor(1, 4);
OSD.print(F("2ND WARN AT % USED:"));
OSD.setCursor(1, 6);
OSD.print(F("1ST WARN AT MAH USED:"));
OSD.setCursor(1, 5);
OSD.print(F("STB CURRENT @5V:"));
OSD.setCursor(1, 7);
OSD.print(F("1ST WARN AT MAH USED:"));
OSD.setCursor(1, 8);
OSD.print(F("2ND WARN AT MAH USED:"));
cursorlineMax = 3;
OSD.setCursor(1, 9);
OSD.print(F("STB CURRENT FROM BAT:"));
cursorlineMax = 4;
break;
case 3:
//Red1
Expand Down Expand Up @@ -289,12 +293,18 @@ void menuprintvalue() {
OSD.setCursor(24, 4);
OSD.print(Settings.Capacity2nd);
OSD.print(" ");
OSD.setCursor(24, 6);
OSD.print((Settings.Capacity * (float)Settings.Capacity1st)/100);
OSD.setCursor(24, 5);
OSD.print(Settings.StandbyCurrent);
OSD.print(" ");
OSD.setCursor(24, 7);
OSD.print((Settings.Capacity * (float)Settings.Capacity1st)/100);
OSD.print(" ");
OSD.setCursor(24, 8);
OSD.print((Settings.Capacity * (float)Settings.Capacity2nd) / 100);
OSD.print(" ");
OSD.setCursor(24, 9);
OSD.print((Settings.StandbyCurrent * 5) / LipoVoltage);
OSD.print(" ");

break;
case 3:
Expand Down Expand Up @@ -468,6 +478,7 @@ void value(bool addsub)
if (Settings.Capacity2nd < Settings.Capacity1st)
Settings.Capacity1st = Settings.Capacity2nd;
break;
case 4: changeval(addsub, 0, 9999, 5, &Settings.StandbyCurrent);
}
break;
case 3:
Expand Down

0 comments on commit caecc15

Please sign in to comment.