-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathn_sk_camelforth.cpp
101 lines (81 loc) · 1.78 KB
/
n_sk_camelforth.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "api/Common.h"
#include "USB/USBAPI.h"
#include <Arduino.h>
/* Mon 3 Jul 18:56:20 UTC 2023 */
#ifdef __cplusplus
extern "C" {
#endif
void this_here();
void interpreter(void);
extern void this_here_now();
void print_the_address(unsigned int *p) {
// unsigned int *q = p;
char buffer[12];
snprintf(buffer, 11, "\n%8x:", p, '\000');
SerialUSB.print(buffer);
}
void print_each_number(unsigned int *p) {
// unsigned int* q = (unsigned int*) *p;
char buffer[12];
buffer[0] = '\000';
snprintf(buffer, 11, " %8X", *p, '\000');
SerialUSB.print(buffer);
}
char getch(void) {
bool waiting_ch = 0;
for (int testing = 5; testing > 0; testing--) {
;
}
while (!waiting_ch) {
bool waiting_now = SerialUSB.available();
waiting_ch = waiting_now;
}
if (waiting_ch) {
unsigned int ch = SerialUSB.read();
return (unsigned int) ch;
}
}
void putch(char c) {
SerialUSB.write(c);
// printf("%c", c);
return; // doesn't have to do anything
}
int getquery(void) {
// return(UARTCharsAvail(UART0_BASE) != 0);
return (0 != 0);
}
void blinker() {
for (int count = 2; count > 0; count--) {
digitalWrite(LED_BUILTIN, 1);
delay(90);
digitalWrite(LED_BUILTIN, 0);
delay(700);
}
}
#ifdef __cplusplus
}
#endif
void talker() {
SerialUSB.println("jobs");
}
void trapped() {
// blinker();
// talker();
interpreter();
while (-1)
;
}
void setup() {
delay(2200);
pinMode(LED_BUILTIN, OUTPUT);
SerialUSB.begin(115200);
// SerialUSB.print("\nCamelforth in C ");
SerialUSB.print("\nspecific to Arduino M0 Pro ");
SerialUSB.println("as in git repo Tue 4 Jul 13:30:25 UTC 2023");
trapped();
}
void loop() {
;
}
// lupine
// END.