wire up firmware flash progress

Also turn off logging and longer checksum interval to improve performance

94K movehub fw flashes in about 1:45
This commit is contained in:
David Lechner
2020-05-20 19:57:23 -05:00
committed by David Lechner
parent 7ba99d62bb
commit 3ae2fb2eef
8 changed files with 81 additions and 39 deletions
+3 -1
View File
@@ -4,6 +4,7 @@ import bootloader, { BootloaderState } from './bootloader';
import editor, { EditorState } from './editor';
import hub, { HubState } from './hub';
import notification, { NotificationState } from './notification';
import status, { StatusState } from './status';
/**
* Root state for redux store.
@@ -14,6 +15,7 @@ export interface RootState {
readonly editor: EditorState;
readonly hub: HubState;
readonly notification: NotificationState;
readonly status: StatusState;
}
export default combineReducers({ bootloader, ble, editor, hub, notification });
export default combineReducers({ bootloader, ble, editor, hub, notification, status });
+18
View File
@@ -0,0 +1,18 @@
import { Reducer } from 'react';
import { combineReducers } from 'redux';
import { BootloaderAction, BootloaderActionType } from '../actions/bootloader';
const progress: Reducer<number, BootloaderAction> = (state = -1, action) => {
switch (action.type) {
case BootloaderActionType.FlashProgress:
return (action.complete / action.total) * 100;
default:
return state;
}
};
export interface StatusState {
readonly progress: number;
}
export default combineReducers({ progress });