U08main.c – Motorola USB08 User Manual

Page 97

Advertising
background image

Source Code Files

Contents

USB08 Evaluation Board

Designer Reference Manual

MOTOROLA

Source Code Files

97

U08MAIN.C

//============================================================================

// File: U08MAIN.C

// Func: Main Module for USB08 Demo Application

// Ver.: 1.00

// Auth: (C)2000,2001 by Oliver Thamm, MCT Elektronikladen GbR

// http://hc08web.de/usb08

// Make: Build the project using U08MAIN.C, U08KEY.C,

//

and VECJB8.C, use CRTSJB8.S as C-Startup Module

// Rem.: View/Edit this File with TAB-Size=4

//============================================================================

//-- Select Interface! -------------------------------------------------------

#define USE_USB_PIPE

// by defining or NOT defining this

// label before compiling, you can

// select the communication interface

// (if defined => USB, if not => RS232)

//-- Includes ----------------------------------------------------------------

#include "hc08jb8.h"

// HC908JB8 Register and Bitmap Definitions

#include "u08key.h"

// Keyboard Module Header File

#include "u08led.h"

// LED Module Header File (just Macros)

#include "u08adc.h"

// Soft ADC Module Header File

//-- Compiler-dependent Stuff ------------------------------------------------

#define cli()

_asm("cli")

#define nop()

_asm("nop")

//-- Data Type Definitions ---------------------------------------------------

typedef unsigned char uchar;

//-- Code Starts here --------------------------------------------------------

#ifdef USE_USB_PIPE

#include "u08usb.c"

// use USB implementation

#define initPipe

initUSB

#define getPipe

getUSB

#define putPipe

putUSB

#else

#include "u08232.c"

// use RS232 implementation

#define initPipe

initSSCI

#define getPipe

getSSCI

#define putPipe

putSSCI

@interrupt void isrUSB() { }

#endif

//----------------------------------------------------------------------------

Advertising