Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed CurrentRanger R3.1.0.UF2
Binary file not shown.
Binary file removed CurrentRanger R3.1.1.UF2
Binary file not shown.
Binary file removed CurrentRanger R3.UF2
Binary file not shown.
744 changes: 0 additions & 744 deletions CurrentRanger_R1.ino
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed for older versions.

This file was deleted.

858 changes: 0 additions & 858 deletions CurrentRanger_R2.ino
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed for older versions.

This file was deleted.

69 changes: 60 additions & 9 deletions CurrentRanger_R3.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
#include <U8g2lib.h> //https://github.com/olikraus/u8g2/wiki/u8g2reference fonts:https://github.com/olikraus/u8g2/wiki/fntlistall
//#include <ATSAMD21_ADC.h>

#define FW_VERSION "1.1.4" //firmware version
#define FW_VERSION "1.1.5" //firmware version
// ********************** CHANGE LOG ***********************************************************************
// 1.1.4 - BUGFIX - USB logging values are half value when CR started without OLED, and until AUTORANGING is toggled
// 1.1.3 - BUGFIX - CR turns off after 21hrs when AUTO-OFF disabled
// 1.1.2 - BUGFIX - BIAS MODE bug fix
// 1.1.5 - FEATURE - NEw USB UI command to reset runtimes settings to default values
// 1.1.4 - BUGFIX - USB logging values are half value when CR started without OLED, and until AUTORANGING is toggled
// 1.1.3 - BUGFIX - CR turns off after 21hrs when AUTO-OFF disabled
// 1.1.2 - BUGFIX - BIAS MODE bug fix
//***********************************************************************************************************
#define BIAS_LED 11
#define LPFPIN 4
Expand Down Expand Up @@ -350,7 +351,7 @@ void loop() {
Serial.print("\nRebooting to bootloader.");
for (byte i=0;i++<30;) { delay(10); Serial.print('.'); }
rebootIntoBootloader();
break;
break;
case 'u': //toggle USB logging
USB_LOGGING_ENABLED =! USB_LOGGING_ENABLED;
Serial.println(USB_LOGGING_ENABLED ? "USB_LOGGING_ENABLED" : "USB_LOGGING_DISABLED");
Expand Down Expand Up @@ -421,6 +422,49 @@ void loop() {
case '4': toggleLPF(); break;
case '5': toggleOffset(); break;
case '6': toggleAutoranging(); break;

case '!': //reset runtime params
USB_LOGGING_ENABLED = false;
Serial.println("USB_LOGGING_DISABLED");

LOGGING_FORMAT=LOGGING_FORMAT_EXPONENT;
eeprom_LOGGINGFORMAT.write(LOGGING_FORMAT);
Serial.println("LOGGING_FORMAT_EXPONENT");

TOUCH_DEBUG_ENABLED = false;
Serial.println( "TOUCH_DEBUG_DISABLED");

GPIO_HEADER_RANGING = false;
Serial.println("GPIO_HEADER_RANGING_DISABLED");

BT_LOGGING_ENABLED = false;
Serial.println("BT_LOGGING_DISABLED");

LOGGING_FORMAT=LOGGING_FORMAT_EXPONENT;
eeprom_LOGGINGFORMAT.write(LOGGING_FORMAT);
Serial.println("LOGGING_FORMAT_EXPONENT");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is repeated on lines 430-432.


ADC_SAMPLING_SPEED=ADC_SAMPLING_SPEED_AVG;
eeprom_ADCSAMPLINGSPEED.write(ADC_SAMPLING_SPEED);
refreshADCSamplingSpeed();
Serial.println("ADC_SAMPLING_SPEED_AVG");

autooff_interval = AUTOOFF_DEFAULT;
eeprom_AUTOFF.write(autooff_interval);
Serial.println("AUTOOFF_DEFAULT");

TOUCH_DEBUG_ENABLED = false;
Serial.println("TOUCH_DEBUG_DISABLED");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is repeated on line 434-435.


if (LPF) toggleLPF();
if (BIAS) toggleOffset();
if (AUTORANGE) toggleAutoranging();
rangeMA();

Serial.println("SETTINGS_RESET");

break;

case '?':
printSerialMenu();
break;
Expand Down Expand Up @@ -521,11 +565,17 @@ void loop() {

if (autoffBuzz) u8g2.drawStr(5,26,"* AUTO OFF! *"); //autoffWarning
u8g2.setFont(u8g2_font_helvB24_te);
u8g2.setCursor(RANGE_MA ? 102 : 106, RANGE_UA ? 55:60); u8g2.print(RANGE_UA ? char('µ') : rangeUnit);
u8g2.setCursor(RANGE_MA ? 102 : 106, RANGE_UA ? 55:60); u8g2.print(RANGE_UA ? char(u'µ') : rangeUnit);
u8g2.setFont(u8g2_font_logisoso32_tr);
u8g2.setCursor(0,64); u8g2.print((BIAS&&abs(VOUT)>=0.4||!BIAS&&VOUT>=0.4)?VOUT:0, abs(VOUT)>=1000?0:1);
if (!BIAS && readDiff>ADC_OVERLOAD || BIAS && abs(readDiff)>ADC_OVERLOAD/2)
{
u8g2.setCursor(0,64);
u8g2.print(
( (BIAS && (abs(VOUT)>=0.4)) || (!BIAS&&(VOUT>=0.4)) )? VOUT:0 ,
(abs(VOUT)>=1000)?0:1
);
if (
(!BIAS && (readDiff>ADC_OVERLOAD)) ||
(BIAS && (abs(readDiff)>ADC_OVERLOAD/2))
) {
u8g2.setFont(u8g2_font_9x15B_tf);
u8g2.drawStr(0,28, "OVERLOAD!");
}
Expand Down Expand Up @@ -863,6 +913,7 @@ void printSerialMenu() {
Serial.println("4 = toggle Low Pass Filter (LPF)");
Serial.println("5 = toggle BIAS (disables AutoRanging)");
Serial.println("6 = toggle AutoRanging (disables BIAS)");
Serial.println("! = reset all runtime settings to defaults");
Serial.println("? = Print this menu and calib info");
Serial.println();
}
Expand Down
Binary file removed CurrentRanger_R3_1.1.2.UF2
Binary file not shown.
Binary file removed CurrentRanger_R3_1.1.3.UF2
Binary file not shown.
Binary file removed CurrentRanger_R3_1.1.4.UF2
Binary file not shown.