PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Propeller GCC Demos
hello
hello.c
1
/*
2
* This is a non-traditional hello demo for Propeller-GCC.
3
* The demo repeats printing every 100ms with the iteration.
4
* It uses waitcnt instead of sleep so it will fit in a COG.
5
*/
6
#include <stdio.h>
7
#include <propeller.h>
8
9
int
main
(
void
)
10
{
11
int
n = 1;
12
while
(1) {
13
waitcnt
(
CLKFREQ
/10+
CNT
);
14
printf(
"Hello World %d\n"
, n);
15
n++;
16
}
17
return
0;
18
}
main
int main(void)
Definition:
GraphicsTest.c:20
CLKFREQ
#define CLKFREQ
Returns the current clock frequency.
Definition:
propeller.h:46
waitcnt
#define waitcnt(a)
Wait until system counter reaches a value.
Definition:
propeller.h:176
CNT
#define CNT
The system clock count.
Definition:
propeller1.h:151
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17