add pass indicator to debug
This commit is contained in:
parent
bab3e086e9
commit
7c52a1ad9e
1 changed files with 11 additions and 2 deletions
|
@ -1,20 +1,29 @@
|
|||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "gpio.h"
|
||||
//////////////////////////////////////////////////////
|
||||
/* Debug přes jednodrátové rozhraní WCH Link.
|
||||
* Je to pomalé a divné, ale funguje to. Sice nevím jak,
|
||||
* ale je to celkem jedno. Fakticky je to kompletně
|
||||
* převzato z https://github.com/cnlohr/ch32v003fun.
|
||||
*
|
||||
* Pozor - program běží jen když je spuštěno
|
||||
* minichlink -T
|
||||
* jinak čeká asi až se odebere znak.
|
||||
* */
|
||||
//////////////////////////////////////////////////////
|
||||
static int n = 0;
|
||||
int main () {
|
||||
GpioClass led (GPIOD, 4);
|
||||
Print cout (DEC);
|
||||
Debug debug;
|
||||
cout += debug;
|
||||
cout << "Begin tests ... \n";
|
||||
for (;;) {
|
||||
cout << "pass: " << n << "\n";
|
||||
|
||||
const bool b = n & 1u;
|
||||
led << b;
|
||||
n += 1u;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue