Skip to content

Commit

Permalink
fix a build error
Browse files Browse the repository at this point in the history
  • Loading branch information
nanovna committed May 1, 2020
1 parent 26ca32a commit e8f9edf
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions main2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "plot.hpp"
#include "uihw.hpp"
#include "ui.hpp"
#include "uihw.hpp"
#include "common.hpp"
#include "globals.hpp"
#include "synthesizers.hpp"
Expand Down Expand Up @@ -115,6 +116,9 @@ small_function<void()> collectMeasurementCB;

void adc_process();


#define myassert(x) if(!(x)) do { errorBlink(3); } while(1)

template<unsigned int N>
static inline void pinMode(const array<Pad, N>& p, int mode) {
for(int i=0; i<(int)N; i++)
Expand Down Expand Up @@ -320,7 +324,7 @@ void lcd_and_ui_setup() {

// tell the plotting code how to calculate frequency in Hz given an index
plot_getFrequencyAt = [](int index) {
return frequencyAt(index);
return UIActions::frequencyAt(index);
};

// the plotter will periodically call this function when doing cpu-heavy work;
Expand All @@ -338,9 +342,9 @@ void lcd_and_ui_setup() {
uiEnableProcessing();

// when the UI hardware emits an event, forward it to the UI code
UIHW::emitEvent = [](UIEvent evt) {
UIHW::emitEvent = [](UIHW::UIEvent evt) {
// process the event on main thread; we are currently in interrupt context.
enqueueEvent([evt]() {
UIActions::enqueueEvent([evt]() {
ui_process(evt);
});
};
Expand Down Expand Up @@ -1203,7 +1207,7 @@ int main(void) {
// there is only one values FIFO that is used in both USB mode
// and normal UI mode; therefore the execution should not reach here
// when we are in USB mode.
assert(!usbDataMode);
myassert(!usbDataMode);

if(sweep_enabled) {
if(processDataPoint()) {
Expand Down Expand Up @@ -1292,6 +1296,12 @@ extern "C" {
errorBlink(6);
while(1);
}
__attribute__((used))
void __assert_fail(const char *__assertion, const char *__file,
unsigned int __line, const char *__function) {
errorBlink(3);
while(1);
}
}


Expand Down

0 comments on commit e8f9edf

Please sign in to comment.