Skip to content

Commit

Permalink
update status fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahparker committed Dec 5, 2016
1 parent 8a15697 commit 1d28e06
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions hardware/oled.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var fb = pitft("/dev/fb0", true);

var oled = {};

var defaultStatus = "";
oled.defaultStatusString = "";
var currentStatus = "";
var chargeStatus = null;
var batteryPercentage = null;
Expand Down Expand Up @@ -558,18 +558,18 @@ oled.status = function(status) {
if(statusTimeoutHandle) clearTimeout(statusTimeoutHandle);
if(status) {
writeStatus(status);
if(defaultStatus) {
if(oled.defaultStatusString) {
statusTimeoutHandle = setTimeout(function(){
writeStatus(defaultStatus);
writeStatus(oled.defaultStatusString);
}, 6000);
}
} else {
writeStatus(defaultStatus);
writeStatus(oled.defaultStatusString);
}
}

oled.defaultStatus = function(status) {
defaultStatus = status;
oled.defaultStatusString = status;
}

oled.chargeStatus = function(status) {
Expand Down
8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ if (VIEW_HARDWARE) {
var SUCCESS = "The camera support library has been successfully updated! Your VIEW intervalometer can now support the latest camera models.";

ui.confirmationPrompt("Update camera support library?", "Update", "cancel", help.saveXMPs, function(cb){
ui.back();
cb();
oled.status("updating camera support");
var backupStatus = oled.defaultStatusString;
oled.defaultStatus("updating camera support");
db.get('libgphoto2-update-in-progress', function(err, val){
if(val) {
console.log("compiling libgphoto2...");
updates.installLibGPhoto(function(err){
oled.status("");
oled.defaultStatus(backupStatus);
process.nextTick(function(){
if(err) { // error compiling
console.log("error compiling libgphoto2", err);
Expand All @@ -129,7 +129,7 @@ if (VIEW_HARDWARE) {
} else {
console.log("downloading libgphoto2...");
updates.downloadLibGPhoto(function(err) {
oled.status("");
oled.defaultStatus(backupStatus);
if(err) { // error downloading
console.log("error downloading libgphoto2", err);
process.nextTick(function(){
Expand Down

0 comments on commit 1d28e06

Please sign in to comment.