Skip to content

Commit

Permalink
signal editor
Browse files Browse the repository at this point in the history
app update (+7 squashed commits)
Squashed commits:
[2a8716e] cleanup
[74faf58] checkpoint 6
[8f56c78] checkpoint 5
[f132ee5] checkpoint 4
[9c7b802] checkpoint 3 - multisignal
[b447347] checkpoint 2
[4111832] checkpoint1
  • Loading branch information
gabonator committed Sep 3, 2023
1 parent 27d0eec commit 2eb49c7
Show file tree
Hide file tree
Showing 32 changed files with 7,030 additions and 205 deletions.
4 changes: 2 additions & 2 deletions system/apps/79_cc1101osc/source/device/cc1101.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ class CDeviceCC1101 : public CCc1101Spi
#ifdef __APPLE__
return true;
#endif
if (mLoaded)
return true;
// if (mLoaded)
// return true;
return Load(nullptr);
}

Expand Down
30 changes: 30 additions & 0 deletions system/apps/79_cc1101osc/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
#include "evaluator.h"
#include "webusb/webusb.h"

extern volatile int totalSamples;
extern volatile int totalPositive;
int lastSamples = 0;
int lastPositive = 0;

char command[128] = {0};
char buffer[128];
const char anim[] = "|/-\\|/-\\";
Expand Down Expand Up @@ -87,7 +92,32 @@ int main(void)
EVERY(1000)
{
BIOS::LCD::Printf(BIOS::LCD::Width-16, BIOS::LCD::Height-14, RGB565(b0b0b0), RGB565(404040), "%c", anim[animphase++&7]);
// BIOS::LCD::Printf(100, BIOS::LCD::Height-14, RGB565(ffb0b0), RGB565(404040), " %d %d ", totalSamples, totalPositive);
}
{EVERY(100)
{
int curSamples = totalSamples - lastSamples;
int curPositive = totalPositive - lastPositive;
lastSamples = totalSamples;
lastPositive = totalPositive;

uint16_t clr = RGB565(404040);
if (curSamples == 0)
clr = RGB565(404040);
else
{
if (curPositive >= curSamples/2)
clr = RGB565(40ff40);
else if (curPositive > 0)
clr = RGB565(40b040);
else
clr = RGB565(808080);
}
if (BIOS::GPIO::DigitalRead(BIOS::GPIO::P4))
clr = RGB565(ffff40);
BIOS::LCD::Bar(CRect(BIOS::LCD::Width-4, BIOS::LCD::Height-4, BIOS::LCD::Width, BIOS::LCD::Height), clr);
}}

APP::Do();
}
APP::End();
Expand Down
2 changes: 2 additions & 0 deletions system/apps/79_cc1101osc/source/streamer/streamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ int streamerBufferMaxCounter = 20000; // 1 second @ 50 kHz
const int streamerPeriodUs = 20;
volatile int totalSamples = 0;
volatile int totalPulses = 0;
volatile int totalPositive = 0;

RingBufCPP<uint16_t, 512> streamerBuffer;

Expand Down Expand Up @@ -125,6 +126,7 @@ void streamerProcess(const volatile uint16_t *data)
{
totalSamples++;
int sample = GetLogic(*data++);
totalPositive += sample;
if (sample == streamerBufferLogic)
{
streamerBufferCounter++;
Expand Down
2 changes: 1 addition & 1 deletion system/apps/79_cc1101osc/web/analyser.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function onMain()
}
})
.then( () => MODEM.Status())
.then( status => { if (status) console.log("Buffer overflow!"); })
.then( status => { if (status) { console.log("Buffer overflow!"); level = 1;} })
.catch(console.log);
}, 200);

Expand Down
211 changes: 211 additions & 0 deletions system/apps/79_cc1101osc/web/editor/demo.js

Large diffs are not rendered by default.

Loading

0 comments on commit 2eb49c7

Please sign in to comment.