Content |
Source File example.c |
Header File example.h |
Header |
// Used libraries
#include <msp430.h>
#include <stdint.h>
// Own header file
#include "example.h"
|
// Include guard
#ifndef EXAMPLE_H_
#define EXAMPLE_H_
|
Global Variables |
// Global variables
const uint8_t example_list[] = { 1, 2, 3 };
uint8_t example_number = 3;
|
// Declaration of the global variables
extern const uint8_t example_list[];
extern uint8_t example_number;
|
Local variables |
// Local variables
static uint8_t counter;
static uint8_t *pointer;
|
--- |
Prototypes of Local Functions |
// Prototypes
static void set_output(uint8_t pattern);
|
--- |
Global Functions |
// Global functions
void example_init(uint8_t x) {
P1DIR = 0xFF;
P1OUT = 0x00;
}
uint8_t example_show() {
set_output(*pointer);
return 1;
}
|
// Prototypes of the global functions
void example_init(uint8_t x);
uint8_t example_show();
|
Local Functions |
// Local Functions
static void set_output(uint8_t pattern) {
P1OUT = pattern;
}
|
--- |
|
--- |
|