Skip to content

Commit

Permalink
added SCOPE_OUTPUT
Browse files Browse the repository at this point in the history
For possible performance measurements with oscilloscope
  • Loading branch information
barry-ha committed Apr 24, 2023
1 parent 984d626 commit 6e41b87
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions view_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,10 @@ void plotCurrentPosition(const PointGPS loc, const PointGPS origin) {
void ViewGrid::updateScreen() {
// called on every pass through main()

// start scope output
pinMode(A0, OUTPUT); // debug - mostly unused pin on rp2040
digitalWrite(A0, HIGH); // debug - output for oscilloscope
#ifdef SCOPE_OUTPUT // start output interval for oscilloscope
pinMode(SCOPE_OUTPUT, OUTPUT); // debug - mostly unused pin on rp2040
digitalWrite(SCOPE_OUTPUT, HIGH); // debug - output for oscilloscope
#endif

// coordinates of lower-left corner of currently displayed grid square
PointGPS gridOrigin{grid.nextGridLineSouth(model->gLatitude), grid.nextGridLineWest(model->gLongitude)};
Expand All @@ -478,9 +479,10 @@ void ViewGrid::updateScreen() {
drawNeighborDistances(); // this is the main goal of the whole project
plotCurrentPosition(myLocation, gridOrigin); // show current pushpin

// end scope output
digitalWrite(A0, LOW); // debug - output for oscilloscope
delay(1); // debug
#ifdef SCOPE_OUTPUT
digitalWrite(SCOPE_OUTPUT, LOW); // end output interval for oscilloscope
delay(1); // debug
#endif
}

void ViewGrid::startScreen() {
Expand Down

0 comments on commit 6e41b87

Please sign in to comment.