Skip to content

Commit

Permalink
Add 1.5.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pcprince committed May 24, 2021
1 parent 0610d09 commit 39ce602
Show file tree
Hide file tree
Showing 35 changed files with 3,680 additions and 1,300 deletions.
8 changes: 4 additions & 4 deletions about.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
const electron = require('electron');
const audiomoth = require('audiomoth-hid');

var versionDisplay = document.getElementById('version-display');
var electronVersionDisplay = document.getElementById('electron-version-display');
var audiomothHidVersionDisplay = document.getElementById('audiomoth-hid-version-display');
var websiteLink = document.getElementById('website-link');
const versionDisplay = document.getElementById('version-display');
const electronVersionDisplay = document.getElementById('electron-version-display');
const audiomothHidVersionDisplay = document.getElementById('audiomoth-hid-version-display');
const websiteLink = document.getElementById('website-link');

versionDisplay.textContent = 'Version ' + electron.remote.app.getVersion();
electronVersionDisplay.textContent = 'Running on Electron version ' + electron.remote.process.versions.electron;
Expand Down
79 changes: 53 additions & 26 deletions constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,102 +13,113 @@ exports.configurations = [{
oversampleRate: 1,
sampleRate: 384000,
sampleRateDivider: 48,
startCurrent: 11.0,
recordCurrent: 10.0
recordCurrent: 9.22,
energySaverRecordCurrent: 5.92,
listenCurrent: 8.59,
energySaverListenCurrent: 5.41
}, {
trueSampleRate: 16,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 384000,
sampleRateDivider: 24,
startCurrent: 11.2,
recordCurrent: 10.9
recordCurrent: 9.83,
energySaverRecordCurrent: 6.63,
listenCurrent: 8.72,
energySaverListenCurrent: 5.54
}, {
trueSampleRate: 32,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 384000,
sampleRateDivider: 12,
startCurrent: 11.5,
recordCurrent: 12.3
recordCurrent: 11.3,
energySaverRecordCurrent: 8.04,
listenCurrent: 8.95,
energySaverListenCurrent: 5.78
}, {
trueSampleRate: 48,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 384000,
sampleRateDivider: 8,
startCurrent: 11.8,
recordCurrent: 14.0
recordCurrent: 12.3,
energySaverRecordCurrent: 8.93,
listenCurrent: 9.14,
energySaverListenCurrent: 5.98
}, {
trueSampleRate: 96,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 384000,
sampleRateDivider: 4,
startCurrent: 12.7,
recordCurrent: 17.4
recordCurrent: 15.8,
energySaverRecordCurrent: 15.8,
listenCurrent: 10.0,
energySaverListenCurrent: 10.0
}, {
trueSampleRate: 192,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 384000,
sampleRateDivider: 2,
startCurrent: 14.5,
recordCurrent: 25.6
recordCurrent: 24.1,
energySaverRecordCurrent: 24.1,
listenCurrent: 11.5,
energySaverListenCurrent: 11.5
}, {
trueSampleRate: 250,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 250000,
sampleRateDivider: 1,
startCurrent: 15.8,
recordCurrent: 29.5
recordCurrent: 26.4,
energySaverRecordCurrent: 26.4,
listenCurrent: 10.6,
energySaverListenCurrent: 10.6
}, {
trueSampleRate: 384,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 384000,
sampleRateDivider: 1,
startCurrent: 18.2,
recordCurrent: 41.6
recordCurrent: 38.5,
energySaverRecordCurrent: 38.5,
listenCurrent: 12.7,
energySaverListenCurrent: 12.7
}];

/* Configuration settings to be used when a device is on firmware < 1.4.4 */
/* Only sent to devices. Not used in energy calculations */

exports.oldConfigurations = [{
trueSampleRate: 8,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 128000,
sampleRateDivider: 16,
startCurrent: 11.0,
recordCurrent: 10.0
sampleRateDivider: 16
}, {
trueSampleRate: 16,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 128000,
sampleRateDivider: 8,
startCurrent: 11.2,
recordCurrent: 10.9
sampleRateDivider: 8
}, {
trueSampleRate: 32,
clockDivider: 4,
acquisitionCycles: 16,
oversampleRate: 1,
sampleRate: 128000,
sampleRateDivider: 4,
startCurrent: 11.5,
recordCurrent: 12.3
sampleRateDivider: 4
}];

/* Packet lengths for each version */
Expand All @@ -131,6 +142,22 @@ exports.packetLengthVersions = [{
}, {
firmwareVersion: '1.5.0',
packetLength: 59
}, {
firmwareVersion: '1.6.0',
packetLength: 62
}];

exports.supportedFirmwareDescs = ['AudioMoth-Firmware-Basic', 'AudioMoth-Firmware-Basic-RC1', 'AudioMoth-Firmware-Basic-RC2', 'AudioMoth-Firmware-Basic-RC3'];
/* Remove trailing digit and check if description is in list of supported firmware descriptions */

exports.isSupportedFirmwareDescription = (desc) => {

const supportedFirmwareDescs = ['AudioMoth-Firmware-Basic', 'AudioMoth-Firmware-Basic-RC'];

return supportedFirmwareDescs.includes(desc.replace(/\d+$/, ''));

};

/* Version number for the latest firmware */

exports.latestFirmwareVersionArray = [1, 6, 0];
exports.latestFirmwareVersionString = '1.6.0';
Loading

0 comments on commit 39ce602

Please sign in to comment.