File: demo_c_0.c

package info (click to toggle)
mcu8051ide 1.4.9-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 18,820 kB
  • sloc: tcl: 94,956; xml: 2,122; sh: 2,113; asm: 246; ansic: 96; awk: 18; makefile: 5
file content (41 lines) | stat: -rw-r--r-- 996 bytes parent folder | download | duplicates (3)
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
/**
 * Very very simple demonstration code written in C language
 * @file demo_c_0.c
 */

// This file defines registers available in AT89x51 MCUs
// See /usr/share/sdcc/include/mcs51/ for alternatives
#include <at89x51.h>

unsigned long some_variable=0;	///< Documentation for this variable comes here
int i;				///< General purpose interator

/**
 * These lines are a doxygen documentation for this function
 * See doxygen manual for more details (http://www.stack.nl/~dimitri/doxygen/manual.html)
 * Note: Try to click on the 1st line of the function declaration and then press Ctrl+E
 * <b style="color: #FF0000">Some bold text</b>
 * @param somevalue Some agrument
 */
void someFunction(unsigned char somevalue)
{
	// P1 and P3 are variables defined in "at89x51.h"
	P1=somevalue;
	P3=somevalue^0xFF;
}

/** Main loop */
int main()
{
	// Infinite loop
	while(1) {
		for(i=0; i<255; i++) {
			someFunction(i+2);
			some_variable++;
		}
		some_variable-=22;
	}

	// Report success
	return 0;
}