/programy/C/avr/akcelerometr/.lfuse |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/C/avr/akcelerometr/a2d.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/buffer.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/timer.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/main.c |
---|
File deleted |
Property changes: |
Deleted: svn:mergeinfo |
/programy/C/avr/akcelerometr/rprintf.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/timer.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/.lock |
---|
File deleted |
\ No newline at end of file |
/programy/C/avr/akcelerometr/avrlibdefs.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/rprintf.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/Makefile |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/uart2.c |
---|
File deleted |
/programy/C/avr/akcelerometr/project.map |
---|
File deleted |
/programy/C/avr/akcelerometr/uart2.h |
---|
File deleted |
/programy/C/avr/akcelerometr/global.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/a2d.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/gmetr.kontrollerlab |
---|
File deleted |
/programy/C/avr/akcelerometr/.hfuse |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/programy/C/avr/akcelerometr/project.hex |
---|
File deleted |
/programy/C/avr/akcelerometr/buffer.c |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/akcelerometr/avrlibtypes.h |
---|
File deleted |
Property changes: |
Deleted: svn:executable |
-* |
\ No newline at end of property |
/programy/C/avr/inclinometer/main.c |
---|
0,0 → 1,97 |
//----- Include Files --------------------------------------------------------- |
#include <avr/io.h> // include I/O definitions (port names, pin names, etc) |
#include <avr/interrupt.h> // include interrupt support |
#include <math.h> |
#include "global.h" // include our global settings |
#include "uart2.h" // include uart function library |
#include "rprintf.h" // include printf function library |
#include "timer.h" // include timer function library (timing, PWM, etc) |
#include "a2d.h" // include A/D converter function library |
//----- Begin Code ------------------------------------------------------------ |
#define BUFLEN 64 |
void radtodeg(double fi, u16 *deg, u08 *min, u08 *sec) //convert radians to degrees mins and seconds |
{ |
double pom; |
fi=fi*180/PI; |
*deg=(u16)trunc(fi); |
pom=(fi-(*deg))*60; |
*min=(u08)trunc(pom); |
*sec=(u08)round((pom-(*min))*60); |
} |
inline double quadraticerror(double average, double buf[], u16 size) // compute average quadratic error |
{ |
u16 i; |
double err=0; |
for(i=0; i<size; i++) err += square(buf[i]-average); // sum quadratic errors |
err = sqrt((1/(double)size)*err); |
return err; |
} |
int main(void) |
{ |
u16 i,x,y; |
double fi, err, fibuf[BUFLEN]; // buffer for recorded and computed values |
u08 fi_min, fi_sec, err_min, err_sec; // computed angles |
u16 fi_deg, err_deg; // computed angles in whole degrees |
// initialize some libraries |
// initialize the UART (serial port) |
uartInit(); |
uartSetBaudRate(0,9600); |
// make all rprintf statements use uart for output |
rprintfInit(uart0SendByte); |
// initialize the timer system |
timerInit(); |
// turn on and initialize A/D converter |
a2dInit(); |
// configure a2d port (PORTA) as input |
// so we can receive analog signals |
DDRF = 0x00; |
// make sure pull-up resistors are turned off |
PORTF = 0x00; |
// set the a2d prescaler (clock division ratio) |
// - a lower prescale setting will make the a2d converter go faster |
// - a higher setting will make it go slower but the measurements |
// will be more accurate |
// - other allowed prescale values can be found in a2d.h |
a2dSetPrescaler(ADC_PRESCALE_DIV128); |
// set the a2d reference |
// - the reference is the voltage against which a2d measurements are made |
// - other allowed reference values can be found in a2d.h |
a2dSetReference(ADC_REFERENCE_AREF); |
// use a2dConvert8bit(channel#) to get an 8bit a2d reading |
// use a2dConvert10bit(channel#) to get a 10bit a2d reading |
rprintf("inklinometr 2009\r\n"); |
while(1) |
{ |
fi=0; |
err=0; |
for(i=0; i<BUFLEN; i++) |
{ |
x = a2dConvert10bit(ADC_CH_ADC0); |
y = a2dConvert10bit(ADC_CH_ADC1); |
fibuf[i] = atan2((double)x-511,(double)y-511); // record computed angles to buffer for post processing |
} |
for(i=0; i<BUFLEN; i++) fi += fibuf[i]; // sum recorded angles |
fi = (fi/BUFLEN)+PI; // average recorded angles and expand product to whole circle |
err=quadraticerror((fi-PI),fibuf,BUFLEN); |
radtodeg(fi,&fi_deg,&fi_min,&fi_sec); //translate radians to degrees |
radtodeg(err,&err_deg,&err_min,&err_sec); |
rprintf("fi:%d.%d.%d +- %d.%d.%d \r\n", fi_deg, fi_min, fi_sec, err_deg, err_min, err_sec); |
delay_ms(20); |
} |
return 0; |
} |
Property changes: |
Added: svn:mergeinfo |
/programy/C/avr/inclinometer/uart2.c |
---|
0,0 → 1,379 |
/*! \file uart2.c \brief Dual UART driver with buffer support. */ |
//***************************************************************************** |
// |
// File Name : 'uart2.c' |
// Title : Dual UART driver with buffer support |
// Author : Pascal Stang - Copyright (C) 2000-2004 |
// Created : 11/20/2000 |
// Revised : 07/04/2004 |
// Version : 1.0 |
// Target MCU : ATMEL AVR Series |
// Editor Tabs : 4 |
// |
// Description : This is a UART driver for AVR-series processors with two |
// hardware UARTs such as the mega161 and mega128 |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
#include <avr/io.h> |
#include <avr/interrupt.h> |
#include "buffer.h" |
#include "uart2.h" |
// UART global variables |
// flag variables |
volatile u08 uartReadyTx[2]; |
volatile u08 uartBufferedTx[2]; |
// receive and transmit buffers |
cBuffer uartRxBuffer[2]; |
cBuffer uartTxBuffer[2]; |
unsigned short uartRxOverflow[2]; |
#ifndef UART_BUFFER_EXTERNAL_RAM |
// using internal ram, |
// automatically allocate space in ram for each buffer |
static char uart0RxData[UART0_RX_BUFFER_SIZE]; |
static char uart0TxData[UART0_TX_BUFFER_SIZE]; |
static char uart1RxData[UART1_RX_BUFFER_SIZE]; |
static char uart1TxData[UART1_TX_BUFFER_SIZE]; |
#endif |
typedef void (*voidFuncPtru08)(unsigned char); |
volatile static voidFuncPtru08 UartRxFunc[2]; |
void uartInit(void) |
{ |
// initialize both uarts |
uart0Init(); |
uart1Init(); |
} |
void uart0Init(void) |
{ |
// initialize the buffers |
uart0InitBuffers(); |
// initialize user receive handlers |
UartRxFunc[0] = 0; |
// enable RxD/TxD and interrupts |
outb(UCSR0B, BV(RXCIE)|BV(TXCIE)|BV(RXEN)|BV(TXEN)); |
// set default baud rate |
uartSetBaudRate(0, UART0_DEFAULT_BAUD_RATE); |
// initialize states |
uartReadyTx[0] = TRUE; |
uartBufferedTx[0] = FALSE; |
// clear overflow count |
uartRxOverflow[0] = 0; |
// enable interrupts |
sei(); |
} |
void uart1Init(void) |
{ |
// initialize the buffers |
uart1InitBuffers(); |
// initialize user receive handlers |
UartRxFunc[1] = 0; |
// enable RxD/TxD and interrupts |
outb(UCSR1B, BV(RXCIE)|BV(TXCIE)|BV(RXEN)|BV(TXEN)); |
// set default baud rate |
uartSetBaudRate(1, UART1_DEFAULT_BAUD_RATE); |
// initialize states |
uartReadyTx[1] = TRUE; |
uartBufferedTx[1] = FALSE; |
// clear overflow count |
uartRxOverflow[1] = 0; |
// enable interrupts |
sei(); |
} |
void uart0InitBuffers(void) |
{ |
#ifndef UART_BUFFER_EXTERNAL_RAM |
// initialize the UART0 buffers |
bufferInit(&uartRxBuffer[0], uart0RxData, UART0_RX_BUFFER_SIZE); |
bufferInit(&uartTxBuffer[0], uart0TxData, UART0_TX_BUFFER_SIZE); |
#else |
// initialize the UART0 buffers |
bufferInit(&uartRxBuffer[0], (u08*) UART0_RX_BUFFER_ADDR, UART0_RX_BUFFER_SIZE); |
bufferInit(&uartTxBuffer[0], (u08*) UART0_TX_BUFFER_ADDR, UART0_TX_BUFFER_SIZE); |
#endif |
} |
void uart1InitBuffers(void) |
{ |
#ifndef UART_BUFFER_EXTERNAL_RAM |
// initialize the UART1 buffers |
bufferInit(&uartRxBuffer[1], uart1RxData, UART1_RX_BUFFER_SIZE); |
bufferInit(&uartTxBuffer[1], uart1TxData, UART1_TX_BUFFER_SIZE); |
#else |
// initialize the UART1 buffers |
bufferInit(&uartRxBuffer[1], (u08*) UART1_RX_BUFFER_ADDR, UART1_RX_BUFFER_SIZE); |
bufferInit(&uartTxBuffer[1], (u08*) UART1_TX_BUFFER_ADDR, UART1_TX_BUFFER_SIZE); |
#endif |
} |
void uartSetRxHandler(u08 nUart, void (*rx_func)(unsigned char c)) |
{ |
// make sure the uart number is within bounds |
if(nUart < 2) |
{ |
// set the receive interrupt to run the supplied user function |
UartRxFunc[nUart] = rx_func; |
} |
} |
void uartSetBaudRate(u08 nUart, u32 baudrate) |
{ |
// calculate division factor for requested baud rate, and set it |
u16 bauddiv = ((F_CPU+(baudrate*8L))/(baudrate*16L)-1); |
if(nUart) |
{ |
outb(UBRR1L, bauddiv); |
#ifdef UBRR1H |
outb(UBRR1H, bauddiv>>8); |
#endif |
} |
else |
{ |
outb(UBRR0L, bauddiv); |
#ifdef UBRR0H |
outb(UBRR0H, bauddiv>>8); |
#endif |
} |
} |
cBuffer* uartGetRxBuffer(u08 nUart) |
{ |
// return rx buffer pointer |
return &uartRxBuffer[nUart]; |
} |
cBuffer* uartGetTxBuffer(u08 nUart) |
{ |
// return tx buffer pointer |
return &uartTxBuffer[nUart]; |
} |
void uartSendByte(u08 nUart, u08 txData) |
{ |
// wait for the transmitter to be ready |
// while(!uartReadyTx[nUart]); |
// send byte |
if(nUart) |
{ |
while(!(UCSR1A & (1<<UDRE))); |
outb(UDR1, txData); |
} |
else |
{ |
while(!(UCSR0A & (1<<UDRE))); |
outb(UDR0, txData); |
} |
// set ready state to FALSE |
uartReadyTx[nUart] = FALSE; |
} |
void uart0SendByte(u08 data) |
{ |
// send byte on UART0 |
uartSendByte(0, data); |
} |
void uart1SendByte(u08 data) |
{ |
// send byte on UART1 |
uartSendByte(1, data); |
} |
int uart0GetByte(void) |
{ |
// get single byte from receive buffer (if available) |
u08 c; |
if(uartReceiveByte(0,&c)) |
return c; |
else |
return -1; |
} |
int uart1GetByte(void) |
{ |
// get single byte from receive buffer (if available) |
u08 c; |
if(uartReceiveByte(1,&c)) |
return c; |
else |
return -1; |
} |
u08 uartReceiveByte(u08 nUart, u08* rxData) |
{ |
// make sure we have a receive buffer |
if(uartRxBuffer[nUart].size) |
{ |
// make sure we have data |
if(uartRxBuffer[nUart].datalength) |
{ |
// get byte from beginning of buffer |
*rxData = bufferGetFromFront(&uartRxBuffer[nUart]); |
return TRUE; |
} |
else |
return FALSE; // no data |
} |
else |
return FALSE; // no buffer |
} |
void uartFlushReceiveBuffer(u08 nUart) |
{ |
// flush all data from receive buffer |
bufferFlush(&uartRxBuffer[nUart]); |
} |
u08 uartReceiveBufferIsEmpty(u08 nUart) |
{ |
return (uartRxBuffer[nUart].datalength == 0); |
} |
void uartAddToTxBuffer(u08 nUart, u08 data) |
{ |
// add data byte to the end of the tx buffer |
bufferAddToEnd(&uartTxBuffer[nUart], data); |
} |
void uart0AddToTxBuffer(u08 data) |
{ |
uartAddToTxBuffer(0,data); |
} |
void uart1AddToTxBuffer(u08 data) |
{ |
uartAddToTxBuffer(1,data); |
} |
void uartSendTxBuffer(u08 nUart) |
{ |
// turn on buffered transmit |
uartBufferedTx[nUart] = TRUE; |
// send the first byte to get things going by interrupts |
uartSendByte(nUart, bufferGetFromFront(&uartTxBuffer[nUart])); |
} |
u08 uartSendBuffer(u08 nUart, char *buffer, u16 nBytes) |
{ |
register u08 first; |
register u16 i; |
// check if there's space (and that we have any bytes to send at all) |
if((uartTxBuffer[nUart].datalength + nBytes < uartTxBuffer[nUart].size) && nBytes) |
{ |
// grab first character |
first = *buffer++; |
// copy user buffer to uart transmit buffer |
for(i = 0; i < nBytes-1; i++) |
{ |
// put data bytes at end of buffer |
bufferAddToEnd(&uartTxBuffer[nUart], *buffer++); |
} |
// send the first byte to get things going by interrupts |
uartBufferedTx[nUart] = TRUE; |
uartSendByte(nUart, first); |
// return success |
return TRUE; |
} |
else |
{ |
// return failure |
return FALSE; |
} |
} |
// UART Transmit Complete Interrupt Function |
void uartTransmitService(u08 nUart) |
{ |
// check if buffered tx is enabled |
if(uartBufferedTx[nUart]) |
{ |
// check if there's data left in the buffer |
if(uartTxBuffer[nUart].datalength) |
{ |
// send byte from top of buffer |
if(nUart) |
outb(UDR1, bufferGetFromFront(&uartTxBuffer[1]) ); |
else |
outb(UDR0, bufferGetFromFront(&uartTxBuffer[0]) ); |
} |
else |
{ |
// no data left |
uartBufferedTx[nUart] = FALSE; |
// return to ready state |
uartReadyTx[nUart] = TRUE; |
} |
} |
else |
{ |
// we're using single-byte tx mode |
// indicate transmit complete, back to ready |
uartReadyTx[nUart] = TRUE; |
} |
} |
// UART Receive Complete Interrupt Function |
void uartReceiveService(u08 nUart) |
{ |
u08 c; |
// get received char |
if(nUart) |
c = inb(UDR1); |
else |
c = inb(UDR0); |
// if there's a user function to handle this receive event |
if(UartRxFunc[nUart]) |
{ |
// call it and pass the received data |
UartRxFunc[nUart](c); |
} |
else |
{ |
// otherwise do default processing |
// put received char in buffer |
// check if there's space |
if( !bufferAddToEnd(&uartRxBuffer[nUart], c) ) |
{ |
// no space in buffer |
// count overflow |
uartRxOverflow[nUart]++; |
} |
} |
} |
UART_INTERRUPT_HANDLER(SIG_UART0_TRANS) |
{ |
// service UART0 transmit interrupt |
uartTransmitService(0); |
} |
UART_INTERRUPT_HANDLER(SIG_UART1_TRANS) |
{ |
// service UART1 transmit interrupt |
uartTransmitService(1); |
} |
UART_INTERRUPT_HANDLER(SIG_UART0_RECV) |
{ |
// service UART0 receive interrupt |
uartReceiveService(0); |
} |
UART_INTERRUPT_HANDLER(SIG_UART1_RECV) |
{ |
// service UART1 receive interrupt |
uartReceiveService(1); |
} |
/programy/C/avr/inclinometer/uart2.h |
---|
0,0 → 1,213 |
/*! \file uart2.h \brief Dual UART driver with buffer support. */ |
//***************************************************************************** |
// |
// File Name : 'uart2.h' |
// Title : Dual UART driver with buffer support |
// Author : Pascal Stang - Copyright (C) 2000-2002 |
// Created : 11/20/2000 |
// Revised : 07/04/2004 |
// Version : 1.0 |
// Target MCU : ATMEL AVR Series |
// Editor Tabs : 4 |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
/// \ingroup driver_avr |
/// \defgroup uart2 UART Driver/Function Library for dual-UART processors (uart2.c) |
/// \code #include "uart2.h" \endcode |
/// \par Overview |
/// This is a UART driver for AVR-series processors with two hardware |
/// UARTs such as the mega161 and mega128. This library provides both |
/// buffered and unbuffered transmit and receive functions for the AVR |
/// processor UART. Buffered access means that the UART can transmit |
/// and receive data in the "background", while your code continues |
/// executing. Also included are functions to initialize the UARTs, |
/// set the baud rate, flush the buffers, and check buffer status. |
/// |
/// \note For full text output functionality, you may wish to use the rprintf |
/// functions along with this driver. |
/// |
/// \par About UART operations |
/// Most Atmel AVR-series processors contain one or more hardware UARTs |
/// (aka, serial ports). UART serial ports can communicate with other |
/// serial ports of the same type, like those used on PCs. In general, |
/// UARTs are used to communicate with devices that are RS-232 compatible |
/// (RS-232 is a certain kind of serial port). |
/// \par |
/// By far, the most common use for serial communications on AVR processors |
/// is for sending information and data to a PC running a terminal program. |
/// Here is an exmaple: |
/// \code |
/// uartInit(); // initialize UARTs (serial ports) |
/// uartSetBaudRate(0, 9600); // set UART0 speed to 9600 baud |
/// uartSetBaudRate(1, 115200); // set UART1 speed to 115200 baud |
/// |
/// rprintfInit(uart0SendByte); // configure rprintf to use UART0 for output |
/// rprintf("Hello UART0\r\n"); // send "hello world" message via UART0 |
/// |
/// rprintfInit(uart1SendByte); // configure rprintf to use UART1 for output |
/// rprintf("Hello UART1\r\n"); // send "hello world" message via UART1 |
/// \endcode |
/// |
/// \warning The CPU frequency (F_CPU) must be set correctly in \c global.h |
/// for the UART library to calculate correct baud rates. Furthermore, |
/// certain CPU frequencies will not produce exact baud rates due to |
/// integer frequency division round-off. See your AVR processor's |
/// datasheet for full details. |
// |
//***************************************************************************** |
//@{ |
#ifndef UART2_H |
#define UART2_H |
#include "global.h" |
#include "buffer.h" |
//! Default uart baud rate. |
/// This is the default speed after a uartInit() command, |
/// and can be changed by using uartSetBaudRate(). |
#define UART0_DEFAULT_BAUD_RATE 9600 ///< default baud rate for UART0 |
#define UART1_DEFAULT_BAUD_RATE 9600 ///< default baud rate for UART1 |
// buffer memory allocation defines |
// buffer sizes |
#ifndef UART0_TX_BUFFER_SIZE |
#define UART0_TX_BUFFER_SIZE 0x0010 ///< number of bytes for uart0 transmit buffer |
#endif |
#ifndef UART0_RX_BUFFER_SIZE |
#define UART0_RX_BUFFER_SIZE 0x0080 ///< number of bytes for uart0 receive buffer |
#endif |
#ifndef UART1_TX_BUFFER_SIZE |
#define UART1_TX_BUFFER_SIZE 0x0010 ///< number of bytes for uart1 transmit buffer |
#endif |
#ifndef UART1_RX_BUFFER_SIZE |
#define UART1_RX_BUFFER_SIZE 0x0080 ///< number of bytes for uart1 receive buffer |
#endif |
// define this key if you wish to use |
// external RAM for the UART buffers |
//#define UART_BUFFER_EXTERNAL_RAM |
#ifdef UART_BUFFER_EXTERNAL_RAM |
// absolute address of uart0 buffers |
#define UART0_TX_BUFFER_ADDR 0x1000 |
#define UART0_RX_BUFFER_ADDR 0x1100 |
// absolute address of uart1 buffers |
#define UART1_TX_BUFFER_ADDR 0x1200 |
#define UART1_RX_BUFFER_ADDR 0x1300 |
#endif |
//! Type of interrupt handler to use for uart interrupts. |
/// Value may be SIGNAL or INTERRUPT. |
/// \warning Do not change unless you know what you're doing. |
#ifndef UART_INTERRUPT_HANDLER |
#define UART_INTERRUPT_HANDLER SIGNAL |
#endif |
// compatibility for the mega161 |
#ifndef RXCIE |
#define RXCIE RXCIE0 |
#define TXCIE TXCIE0 |
#define UDRIE UDRIE0 |
#define RXEN RXEN0 |
#define TXEN TXEN0 |
#define CHR9 CHR90 |
#define RXB8 RXB80 |
#define TXB8 TXB80 |
#endif |
#ifndef UBRR0L |
#define UBRR0L UBRR0 |
#define UBRR1L UBRR1 |
#endif |
// functions |
//! Initializes UARTs. |
/// \note After running this init function, the processor |
/// I/O pins that used for uart communications (RXD, TXD) |
/// are no long available for general purpose I/O. |
void uartInit(void); |
//! Initializes UART0 only. |
void uart0Init(void); |
//! Initializes UART1 only. |
void uart1Init(void); |
//! Initializes transmit and receive buffers. |
/// Automatically called from uartInit() |
void uart0InitBuffers(void); |
void uart1InitBuffers(void); |
//! Redirects received data to a user function. |
/// |
void uartSetRxHandler(u08 nUart, void (*rx_func)(unsigned char c)); |
//! Sets the uart baud rate. |
/// Argument should be in bits-per-second, like \c uartSetBaudRate(9600); |
void uartSetBaudRate(u08 nUart, u32 baudrate); |
//! Returns pointer to the receive buffer structure. |
/// |
cBuffer* uartGetRxBuffer(u08 nUart); |
//! Returns pointer to the transmit buffer structure. |
/// |
cBuffer* uartGetTxBuffer(u08 nUart); |
//! Sends a single byte over the uart. |
/// |
void uartSendByte(u08 nUart, u08 data); |
//! SendByte commands with the UART number hardcoded |
/// Use these with printfInit() - example: \c printfInit(uart0SendByte); |
void uart0SendByte(u08 data); |
void uart1SendByte(u08 data); |
//! Gets a single byte from the uart receive buffer. |
/// Returns the byte, or -1 if no byte is available (getchar-style). |
int uart0GetByte(void); |
int uart1GetByte(void); |
//! Gets a single byte from the uart receive buffer. |
/// Function returns TRUE if data was available, FALSE if not. |
/// Actual data is returned in variable pointed to by "data". |
/// Example usage: |
/// \code |
/// char myReceivedByte; |
/// uartReceiveByte(0, &myReceivedByte ); |
/// \endcode |
u08 uartReceiveByte(u08 nUart, u08* data); |
//! Returns TRUE/FALSE if receive buffer is empty/not-empty. |
/// |
u08 uartReceiveBufferIsEmpty(u08 nUart); |
//! Flushes (deletes) all data from receive buffer. |
/// |
void uartFlushReceiveBuffer(u08 nUart); |
//! Add byte to end of uart Tx buffer. |
/// |
void uartAddToTxBuffer(u08 nUart, u08 data); |
//! AddToTxBuffer commands with the UART number hardcoded |
/// Use this with printfInit() - example: \c printfInit(uart0AddToTxBuffer); |
void uart0AddToTxBuffer(u08 data); |
void uart1AddToTxBuffer(u08 data); |
//! Begins transmission of the transmit buffer under interrupt control. |
/// |
void uartSendTxBuffer(u08 nUart); |
//! sends a buffer of length nBytes via the uart using interrupt control. |
/// |
u08 uartSendBuffer(u08 nUart, char *buffer, u16 nBytes); |
//! interrupt service handlers |
void uartTransmitService(u08 nUart); |
void uartReceiveService(u08 nUart); |
#endif |
/programy/C/avr/inclinometer/Makefile |
---|
0,0 → 1,51 |
NAME := gpsrl |
HEX := $(NAME).hex |
OUT := $(NAME).out |
MAP := $(NAME).map |
SOURCES := $(wildcard *.c) |
HEADERS := $(wildcard *.h) |
OBJECTS := $(patsubst %.c,%.o,$(SOURCES)) |
MCU := atmega64 |
MCU_AVRDUDE := m64 |
CC := avr-gcc |
OBJCOPY := avr-objcopy |
SIZE := avr-size -A |
DOXYGEN := doxygen |
CFLAGS := -Wall -pedantic -mmcu=$(MCU) -std=c99 -g -Os |
all: $(HEX) |
clean: |
rm -f $(HEX) $(OUT) $(MAP) $(OBJECTS) |
rm -rf doc/html |
flash: $(HEX) |
avrdude -y -p $(MCU_AVRDUDE) -P /dev/ttyUSB0 -c stk500v2 -U flash:w:$(HEX) |
$(HEX): $(OUT) |
$(OBJCOPY) -R .eeprom -O ihex $< $@ |
$(OUT): $(OBJECTS) |
$(CC) $(CFLAGS) -o $@ -Wl,-Map,$(MAP) $^ |
@echo |
@$(SIZE) $@ |
@echo |
%.o: %.c $(HEADERS) |
$(CC) $(CFLAGS) -c -o $@ $< |
%.pp: %.c |
$(CC) $(CFLAGS) -E -o $@ $< |
%.ppo: %.c |
$(CC) $(CFLAGS) -E $< |
doc: $(HEADERS) $(SOURCES) Doxyfile |
$(DOXYGEN) Doxyfile |
.PHONY: all clean flash doc |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/gmetr.kontrollerlab |
---|
0,0 → 1,68 |
<!DOCTYPE KontrollerLab> |
<PROJECT VERSION="0.8.0-beta1" > |
<FILES> |
<FILE VIEWS="0,0,1024,445,5," SHOWN="TRUE" NAME="a2dtest.c" /> |
<FILE SHOWN="FALSE" NAME="avrlibdefs.h" /> |
<FILE SHOWN="FALSE" NAME="avrlibtypes.h" /> |
<FILE SHOWN="FALSE" NAME="a2d.c" /> |
<FILE SHOWN="FALSE" NAME="a2d.h" /> |
<FILE SHOWN="FALSE" NAME="buffer.c" /> |
<FILE SHOWN="FALSE" NAME="buffer.h" /> |
<FILE SHOWN="FALSE" NAME="global.h" /> |
<FILE SHOWN="FALSE" NAME="rprintf.c" /> |
<FILE SHOWN="FALSE" NAME="rprintf.h" /> |
<FILE SHOWN="FALSE" NAME="timer.c" /> |
<FILE SHOWN="FALSE" NAME="timer.h" /> |
<FILE SHOWN="FALSE" NAME="uart2.c" /> |
<FILE SHOWN="FALSE" NAME="uart2.h" /> |
</FILES> |
<SETTINGS> |
<ASSEMBLER_COMMAND VALUE="avr-gcc" /> |
<BUILD_SYSTEM VALUE="BUILT_IN_BUILD" /> |
<CLOCK VALUE="8e+06" /> |
<COMPILER_CALL_PROLOGUES VALUE="FALSE" /> |
<COMPILER_COMMAND VALUE="avr-gcc" /> |
<COMPILER_F_CPU VALUE="FALSE" /> |
<COMPILER_GDEBUG VALUE="FALSE" /> |
<COMPILER_OPT_LEVEL VALUE="2" /> |
<COMPILER_STRICT_PROTOTYPES VALUE="TRUE" /> |
<COMPILER_WALL VALUE="TRUE" /> |
<CPU VALUE="ATMega64" /> |
<HEX_FILE VALUE="project.hex" /> |
<LINKER_COMMAND VALUE="avr-gcc" /> |
<LINKER_FLAGS VALUE="" /> |
<MAKE_CLEAN_TARGET VALUE="clean" /> |
<MAKE_COMMAND VALUE="make" /> |
<MAKE_DEFAULT_TARGET VALUE="all" /> |
<MAP_FILE VALUE="project.map" /> |
<OBJCOPY_COMMAND VALUE="avr-objcopy" /> |
</SETTINGS> |
<DEBUGGER_SETTINGS/> |
<PROGRAMMERCONFIG> |
<AVRDUDE_CONNECTION_PORT VALUE="/dev/parport0" /> |
<AVRDUDE_COUNT_ERASE VALUE="FALSE" /> |
<AVRDUDE_DISABLE_AUTO_ERASE VALUE="FALSE" /> |
<AVRDUDE_OVERRIDE_INVALID_SIGNATURE VALUE="FALSE" /> |
<AVRDUDE_PROGRAMMER_TYPE VALUE="dapa" /> |
<AVRDUDE_TEST_MODE VALUE="FALSE" /> |
<PROGRAMMER_COMMAND VALUE="avrdude" /> |
<PROGRAMMER_NAME VALUE="AVRDUDE" /> |
<UISP_PARALLEL_AT89S VALUE="FALSE" /> |
<UISP_PARALLEL_DISABLE_RETRIES VALUE="FALSE" /> |
<UISP_PARALLEL_EEPROM_MAX_WRITE_DELAY VALUE="2777" /> |
<UISP_PARALLEL_FLASH_MAX_WRITE_DELAY VALUE="2777" /> |
<UISP_PARALLEL_NO_DATA_POLLING VALUE="FALSE" /> |
<UISP_PARALLEL_PORT VALUE="" /> |
<UISP_PARALLEL_RESET_HIGH_TIME VALUE="0" /> |
<UISP_PARALLEL_SCK_HIGH_LOW_TIME VALUE="0" /> |
<UISP_PARALLEL_VOLTAGE VALUE="0" /> |
<UISP_PROGRAMMER_TYPE VALUE="" /> |
<UISP_SERIAL_PORT VALUE="" /> |
<UISP_SERIAL_SPEED VALUE="9600" /> |
<UISP_SPECIFY_PART VALUE="FALSE" /> |
<UISP_STK500_AREF_VOLTAGE VALUE="0" /> |
<UISP_STK500_OSCILLATOR_FREQUENCY VALUE="14.1" /> |
<UISP_STK500_USE_HIGH_VOLTAGE VALUE="FALSE" /> |
<UISP_STK500_VTARGET_VOLTAGE VALUE="0" /> |
</PROGRAMMERCONFIG> |
</PROJECT> |
/programy/C/avr/inclinometer/project.hex |
---|
0,0 → 1,718 |
:100000000C948B000C94A8000C94A8000C94A800ED |
:100010000C94A8000C94A8000C94A8000C94A800C0 |
:100020000C94A8000C94C3080C941B080C94A6080C |
:100030000C946C080C9489080C94FE070C944F08DF |
:100040000C94B7070C94A8000C94B4090C94A80065 |
:100050000C949A0A0C94EE020C94A8000C94A8003C |
:100060000C94A8000C94A8000C94A8000C94A80070 |
:100070000C94A8000C94A8000C94A5090C94A8005A |
:100080000C948B0A0C94A8000C94A800084AD73B47 |
:100090003BCE016E84BCBFFDC12F3D6C74319ABD57 |
:1000A00056833DDA3D00C77F11BED9E4BB4C3E917B |
:1000B0006BAAAABE000000803F66693A25642E251F |
:1000C000642E256420202B2D2025642E25642E25CA |
:1000D00064200D0A00696E6B6C696E6F6D657472D9 |
:1000E00020323030390D0A00303132333435363772 |
:1000F00038394142434445460000000100080040B1 |
:100100000000010004000001000800200040008001 |
:1001100000000100040011241FBECFEFD0E1DEBFBC |
:10012000CDBF12E0A0E0B1E0E8EBFBE202C0059039 |
:100130000D92A830B107D9F713E0A8E0B2E001C0F2 |
:100140001D92A337B107E1F70E947E010C94DA15E6 |
:100150000C9400006F927F928F929F92AF92BF9209 |
:10016000CF92DF92EF92FF920F931F93CF93DF9383 |
:100170003B014C0169012115310509F456C05A01B2 |
:10018000C0E0D0E00F2EF0E0EF2EF0E0FF2EF0E028 |
:100190000F2FF0E01F2FF02DA4019301F5016191C5 |
:1001A0007191819191915F010E94210D0E9427150B |
:1001B0009B01AC01C801B7010E94520D7B018C016B |
:1001C0002196CC15DD0540F30894C108D108B6018D |
:1001D00080E090E00894C11CD11C0E9405109B0196 |
:1001E000AC01C801B7010E94790E0E94DD147B01A9 |
:1001F0008C01B60180E090E00E9405100E94DD14A1 |
:100200009B01AC01C801B7010E94790EDF91CF912B |
:100210001F910F91FF90EF90DF90CF90BF90AF9024 |
:100220009F908F907F906F9008950F2EF0E0EF2EAB |
:10023000F0E0FF2EF0E00F2FF0E01F2FF02DC4CFE5 |
:100240008F929F92AF92BF92CF92DF92EF92FF92E6 |
:100250000F931F936A015901480120E030E044E305 |
:1002600053E40E947F0D2BED3FE049E450E40E94EF |
:10027000790E7B018C010E942A150E94AC0BF601BD |
:100280007183608380E090E00E9405109B01AC01C7 |
:10029000C801B7010E94210D20E030E040E752E4A0 |
:1002A0000E947F0D7B018C010E942A150E94AC0BDD |
:1002B000F501608370E0882777FD8095982F0E9474 |
:1002C000530F9B01AC01C801B7010E94210D20E032 |
:1002D00030E040E752E40E947F0D0E94B9140E9472 |
:1002E000AC0BF40160831F910F91FF90EF90DF90B2 |
:1002F000CF90BF90AF909F908F9008952F923F9294 |
:100300004F925F926F927F928F929F92AF92BF9225 |
:10031000CF92DF92EF92FF920F931F93DF93CF93D1 |
:10032000CDB7DEB7C850D1400FB6F894DEBF0FBED0 |
:10033000CDBF0E94A70B40E855E260E070E080E08E |
:100340000E94EC0881E599E00E94AE030E94E3055B |
:100350000E94A602109261001092620087E00E9443 |
:10036000B90280E00E94BE0285ED90E09F938F93DA |
:1003700081E08F930E942305882499240F900F9089 |
:100380000F9049E0242E312C2C0E3D1E39E0432ED7 |
:1003900031E0532E4C0E5D1E30E48316910408F4B8 |
:1003A0009DC0810160E070E080E090E0F801219163 |
:1003B0003191419151918F010E94520D0415150503 |
:1003C000A9F720E030E040E85CE30E947F0D2BEDD0 |
:1003D0003FE049E450E40E94520D3B014C015101C1 |
:1003E0000F2EF0E0CF2EF0E0DF2EF0E0EF2EF0E069 |
:1003F000FF2EF02DA4019301F5016191719181917E |
:1004000091915F010E94210D0E9427159B01AC0173 |
:10041000C701B6010E94520D6B017C01A016B10606 |
:1004200049F720E030E04CE752E40E94790E0E9448 |
:10043000DD146B017C018E010E5F1F4F9E012F5F4B |
:100440003F4FAE014B5F5F4FC401B3010E942001DB |
:1004500020E030E040E05EE3C701B6010E947F0D7E |
:100460008E010C5F1F4F9E012D5F3F4FAE01495F14 |
:100470005F4F0E9420018C8190E09F938F938B812E |
:1004800090E09F938F938F8198859F938F938A811C |
:1004900090E09F938F93898190E09F938F938D81BC |
:1004A0009E819F938F9329EB30E03F932F9381E0C0 |
:1004B0008F930E94230584E190E00E949306882494 |
:1004C00099248DB79EB70F960FB6F8949EBF0FBEB6 |
:1004D0008DBF30E48316910408F063CF80E00E9462 |
:1004E000D3027C0181E00E94D302A0E0B0E0BC0115 |
:1004F000CD010E94051020E030E84FEF53E40E9448 |
:10050000210D5B016C0100E010E0C801B7010E9401 |
:10051000051020E030E84FEF53E40E94210DA601C2 |
:1005200095010E942213F401EE0FFF1FEE0FFF1F33 |
:1005300021E030E02C0F3D1FE20FF31F6087718731 |
:10054000828793870894811C911C26CF379A35980F |
:1005500086B1887F866086B987B18F73806487B9DA |
:100560003D98339A10923E037894089533983798C3 |
:10057000089596B1987F982B96B9089597B1829572 |
:10058000880F880F807C9F73982B97B9089597B137 |
:100590008F71907E892B87B90895349A369A089581 |
:1005A00086B18074089510923E0397B18F71907E4A |
:1005B000892B87B9349A369A3699FECF24B145B142 |
:1005C000942F80E030E0282B392BC90108950E9438 |
:1005D000D302969587959695879508951F920F92C9 |
:1005E0000FB60F9211248F938FEF80933E038F915C |
:1005F0000F900FBE0F901F901895FC018FB7F894C5 |
:10060000718360835383428317821682158214821A |
:100610008FBF0895CF93DF93DC016FB7F894EC019F |
:100620002C813D812115310509F1FC0186819781DD |
:10063000ED91FC911197E80FF91FE0810196ED0112 |
:100640009F838E834A815B818417950750F42150E4 |
:100650003040ED013D832C836FBF8E2FDF91CF9112 |
:100660000895841B950B9F838E83F1CFE0E06FBFCD |
:100670008E2FDF91CF910895FC01AFB7F8942481BC |
:10068000358162177307A8F486819781860F971FBB |
:1006900097838683428153818417950720F0841BBA |
:1006A000950B97838683261B370B35832483AFBF37 |
:1006B000089515821482AFBF0895FC01CB012FB7B6 |
:1006C000F8942FBF2681378162817381820F931F37 |
:1006D0000E948B120190F081E02DE80FF91F8081BC |
:1006E00008951F93CF93DF93EC01462F1FB7F89423 |
:1006F0002C813D816A817B8126173707B0F48E817A |
:100700009F81820F931F0E948B12E881F981E80F6D |
:10071000F91F40838C819D8101969D838C831FBF2F |
:100720008FEFDF91CF911F9108951FBF80E0DF9180 |
:10073000CF911F910895FC018FB7F8948FBF22814C |
:10074000338184819581281B390BC9010895FC01EF |
:100750008FB7F894158214828FBF08959093090281 |
:100760008093080208951F93182F8A3041F0E0917A |
:100770000802F0910902812F09951F910895E091D7 |
:100780000802F09109028DE00995E0910802F091CC |
:100790000902812F09951F910895CF93DF93EC01F2 |
:1007A000009721F406C021960E94B3038881882314 |
:1007B000D1F7DF91CF910895EF92FF920F931F939E |
:1007C000CF93DF938C017A01009729F120E030E08C |
:1007D0002617370738F4F80181918F012F5F3F4FBB |
:1007E0008823B1F7E114F104B1F0C0E0D0E008C013 |
:1007F0000F5F1F4F0E94B3032196CE15DF0558F4FB |
:10080000F80180818823A1F780E20E94B30321963A |
:10081000CE15DF05A8F3DF91CF911F910F91FF90C7 |
:10082000EF900895CF93DF93FC01009761F08491DE |
:10083000882349F0EF0121960E94B303FE0121961F |
:1008400084918823C9F7DF91CF9108958AE00E94AF |
:10085000B3030895E82FF0E0EF70F070E851FF4F18 |
:10086000E4918E2F0E94B30308951F93182F829551 |
:100870008F700E942A04812F0E942A041F910895DC |
:100880001F93182F892F0E943504812F0E94350451 |
:100890001F910895EF92FF920F931F937B018C019C |
:1008A000C801AA27BB270E944004C7010E94400438 |
:1008B0001F910F91FF90EF9008952F923F924F92CA |
:1008C0005F926F927F928F929F92AF92BF92CF92E0 |
:1008D000DF92EF92FF920F931F93DF93CF93CDB7E9 |
:1008E000DEB7A4970FB6F894DEBF0FBECDBF6BA3E3 |
:1008F000A42E2CA317012801442311F017FD98C042 |
:10090000820171012BA121502AA390E0A11091E056 |
:10091000EAA1E91BE9A318A2682E772467FC70946A |
:10092000872C972CC801B701A40193010E949F1244 |
:10093000FB01EF70F070E851FF4F64916F8FC801B9 |
:10094000B701A40193010E949F12C901DA017C0141 |
:100950008D019EE1C92ED12CCC0EDD1EB9A01CC08C |
:10096000C801B701A40193010E949F12FB01EF701F |
:10097000F070E851FF4F6491F6016083C801B70140 |
:10098000A40193010E949F12C901DA017C018D012B |
:10099000BA940894C108D108BB2049F0E114F104CD |
:1009A00001051105E9F62CA1F6012083F1CFCE0156 |
:1009B0004F96FC0129A1E21BF109AA2049F057FC3E |
:1009C00034C02114310441045104D1F18BE28293EB |
:1009D0008BA1882389F08F019AA1E92EFF24089426 |
:1009E000E11CF11CEE0EFF1EF80181918F010E94A7 |
:1009F000B3030E151F05C1F7A4960FB6F894DEBF1A |
:100A00000FBECDBFCF91DF911F910F91FF90EF905F |
:100A1000DF90CF90BF90AF909F908F907F906F901E |
:100A20005F904F903F902F9008958DE28293D0CFAA |
:100A3000EE24FF248701E218F3080409150962CFA8 |
:100A400080E28293C5CF7F928F929F92AF92BF92A6 |
:100A5000CF92DF92EF92FF920F931F93DF93CF938A |
:100A6000CDB7DEB77888C988DA888E010D5E1F4F52 |
:100A7000772081F0F6010894C11CD11C8491853245 |
:100A800071F0882309F474C00E94B3034801840103 |
:100A9000772081F7F60181916F01853291F77720F8 |
:100AA00081F0F6010894C11CD11C8491843671F048 |
:100AB0008837D9F1833689F148010E94B303840154 |
:100AC000E7CFF60181916F01843691F722E0822E03 |
:100AD000912C800E911EF801E080F180FF200CF433 |
:100AE00057C0F0E1EF16F7E2FF0608F059C088EEB4 |
:100AF000E81683E0F80608F059C0E4E6EE16F104C3 |
:100B000008F05AC0FAE0EF16F10408F058C001E00E |
:100B100010E04AE0A42EB12C15C0E2E08E2E912CFC |
:100B2000800E911EF8018081C8CF72E0872E912C33 |
:100B3000800E911EF801E080F18000E010E160E19C |
:100B4000A62EB12CC701B8010E948B12862F0E94DD |
:100B50002A04C701B8010E948B127C01C801B501AB |
:100B60000E948B128B016115710561F7840190CF92 |
:100B700080E090E0CF91DF911F910F91FF90EF9077 |
:100B8000DF90CF90BF90AF909F908F907F9008950F |
:100B9000F094E194F108F3948DE20E94B303A1CFA5 |
:100BA00000E117E25AE0A52EB12CCCCF08EE13E0FD |
:100BB0003AE0A32EB12CC6CF04E610E0F9CF0AE04C |
:100BC00010E0F6CF089580E090E0FC01EE0FFF1FEB |
:100BD000E65FFD4F11821082019688309105A9F7DA |
:100BE00083B7887F826083BF12BE87B7816087BF6B |
:100BF00010923F031092400310924103109242035F |
:100C00008EB5887F83608EBD1DBC1CBC87B7846099 |
:100C100087BF85B5887F846085BD14BC87B7806435 |
:100C200087BF109247031092480310924903109215 |
:100C30004A037894089583B7887F826083BF12BE89 |
:100C400087B7816087BF10923F03109240031092D4 |
:100C500041031092420308958EB5887F83608EBD54 |
:100C60001DBC1CBC87B7846087BF089585B5887F8D |
:100C7000846085BD14BC87B7806487BF109247032A |
:100C8000109248031092490310924A03089593B7B3 |
:100C9000987F982B93BF08959EB5987F982B9EBD03 |
:100CA000089595B5987F982B95BD089583B7E82F43 |
:100CB000F0E0E770F070EE0FFF1FE750FF4F259157 |
:100CC0003491C90108958EB5E82FF0E0E770F07017 |
:100CD000EE0FFF1FE750FF4F25913491C901089592 |
:100CE00085B5E82FF0E0E770F070EE0FFF1FEB5FC7 |
:100CF000FE4F25913491C9010895883040F4E82FC2 |
:100D0000F0E0EE0FFF1FE65FFD4F718360830895F3 |
:100D1000883040F4E82FF0E0EE0FFF1FE65FFD4F54 |
:100D2000118210820895DF92EF92FF920F931F932A |
:100D30008C01D2B6109243031092440310924503E3 |
:100D40001092460383B7E82FF0E0E770F070EE0FE3 |
:100D5000FF1FE750FF4F2591349140E050E060E0E5 |
:100D600072E18AE790E00E94C112B901CA01693BB1 |
:100D70002DE8720726E0820720E0920728F427E298 |
:100D80000131120708F44EC028EE33E040E050E095 |
:100D90000E949F12CA01B901980140E050E00E94F0 |
:100DA0006C127B018C0120914303309144034091EC |
:100DB00045035091460382B7ED0CF11C011D111D36 |
:100DC0001BC08091430390914403A0914503B091CF |
:100DD000460385B7837E85BF85B7806285BF8895CA |
:100DE00085B78F7D85BF20914303309144034091A7 |
:100DF00045035091460382B790E0A0E0B0E0542F45 |
:100E0000432F322F2227822B932BA42BB52B8E1509 |
:100E10009F05A007B107A8F21F910F91FF90EF90D7 |
:100E2000DF900895980140E050E00E946C1228EE97 |
:100E300033E040E050E00E949F12C901DA017C01DA |
:100E40008D01B1CF10923F031092400310924103E5 |
:100E500010924203089520913F0330914003409146 |
:100E6000410350914203B901CA010895109247030A |
:100E7000109248031092490310924A03089520915A |
:100E80004703309148034091490350914A03B90107 |
:100E9000CA010895893069F08A30B1F08FB58D7F2D |
:100EA0008FBD8FB581608FBD1BBC1ABC19BC18BC2F |
:100EB00008958FB582608FBD8FB58E7F8FBD1BBCAF |
:100EC0001ABC19BC18BC08958FB582608FBD8FB550 |
:100ED00081608FBD1BBC1ABC19BC18BC08952FB50E |
:100EE0002E7F2FBD2FB522602FBD2EB528602EBDC1 |
:100EF0002EB520612EBD97BD86BD1BBC1ABC19BC8A |
:100F000018BC08958FB58D7F8FBD8FB58E7F8FBD37 |
:100F10008FB58F778FBD8FB58F7B8FBD8FB58F7D51 |
:100F20008FBD8FB58F7E8FBD08958FB580688FBDC3 |
:100F30008FB58F7B8FBD08958FB580628FBD8FB5C4 |
:100F40008F7E8FBD08958FB58F778FBD8FB58F7BC7 |
:100F50008FBD08958FB58F7D8FBD8FB58F7E8FBD6F |
:100F600008959BBD8ABD089599BD88BD08951F92BF |
:100F70000F920FB60F9211248F939F93AF93BF934D |
:100F8000EF93FF9380913F0390914003A091410321 |
:100F9000B09142030196A11DB11D80933F03909330 |
:100FA0004003A0934103B093420380914303909187 |
:100FB0004403A0914503B09146030196A11DB11DC4 |
:100FC0008093430390934403A0934503B093460357 |
:100FD00080910A0290910B02892B29F0E0910A027C |
:100FE000F0910B020995FF91EF91BF91AF919F9105 |
:100FF0008F910F900FBE0F901F9018951F920F9218 |
:101000000FB60F9211248F939F93EF93FF938091CC |
:101010000C0290910D02892B29F0E0910C02F091C5 |
:101020000D020995FF91EF919F918F910F900FBE47 |
:101030000F901F9018951F920F920FB60F921124C8 |
:101040008F939F93AF93BF93EF93FF938091470349 |
:1010500090914803A0914903B0914A030196A11DC4 |
:10106000B11D8093470390934803A0934903B09325 |
:101070004A038091140290911502892B29F0E09186 |
:101080001402F09115020995FF91EF91BF91AF9174 |
:101090009F918F910F900FBE0F901F9018951F92E8 |
:1010A0000F920FB60F9211248F939F93EF93FF939C |
:1010B0008091180290911902892B29F0E091180271 |
:1010C000F09119020995FF91EF919F918F910F90E7 |
:1010D0000FBE0F901F9018951F920F920FB60F9290 |
:1010E00011248F939F93EF93FF9380910E02909121 |
:1010F0000F02892B29F0E0910E02F0910F02099561 |
:10110000FF91EF919F918F910F900FBE0F901F90C5 |
:1011100018951F920F920FB60F9211248F939F93E1 |
:10112000EF93FF938091100290911102892B29F087 |
:10113000E0911002F09111020995FF91EF919F91BA |
:101140008F910F900FBE0F901F9018951F920F92C6 |
:101150000FB60F9211248F939F93EF93FF9380917B |
:10116000120290911302892B29F0E0911202F09162 |
:1011700013020995FF91EF919F918F910F900FBEF0 |
:101180000F901F9018951F920F920FB60F92112477 |
:101190008F939F93EF93FF93809116029091170284 |
:1011A000892B29F0E0911602F09117020995FF9121 |
:1011B000EF919F918F910F900FBE0F901F901895F8 |
:1011C000823008F00895E82FF0E0EE0FFF1FE65C94 |
:1011D000FC4F7183608308951F93182F9A01AB0110 |
:1011E000CA01B901605C7D4B804F9F4F660F771F2E |
:1011F000881F991F660F771F881F991F660F771F1B |
:10120000881F991F220F331F441F551F220F331FA2 |
:10121000441F551F220F331F441F551F220F331F1A |
:10122000441F551F0E949F1221503040112329F462 |
:1012300029B9309390001F9108952093990030931D |
:1012400098001F910895282F30E0220F331F220F9E |
:10125000331F220F331F235B3C4FC9010895282FF2 |
:1012600030E0220F331F220F331F220F331F215A6A |
:101270003C4FC9010895E82F882359F080919B00C5 |
:1012800085FFFCCF60939C00F0E0E55BFC4F108293 |
:1012900008955D9BFECF6CB9F0E0E55BFC4F1082DA |
:1012A00008955D9BFECF8CB910924B030895982F43 |
:1012B00080919B0085FFFCCF90939C0010924C0383 |
:1012C000089520E0E82FF0E0EE0FFF1FEE0FFF1F64 |
:1012D000EE0FFF1FEF5AFC4F80819181892B09F49B |
:1012E00021E0822F0895CF93DF938823B1F060919E |
:1012F0009C00282F30E0E901CC0FDD1FFE01E65CE9 |
:10130000FC4F80819181892B51F00190F081E02D7B |
:10131000862F0995DF91CF9108956CB1EACF220F06 |
:10132000331F220F331F220F331FC901835B9C4FD2 |
:101330000E947103882371F7FE01E159FC4F8081FF |
:101340009181019691838083E5CF1F920F920FB612 |
:101350000F9211248F9381E00E9473098F910F9057 |
:101360000FBE0F901F9018951F920F920FB60F92FD |
:1013700011248F9380E00E9473098F910F900FBE0C |
:101380000F901F9018958F929F92AF92BF92CF921D |
:10139000DF92EF92FF920F931F93CF93DF93982EDC |
:1013A000DB01C82EDD24F601EE0FFF1FEE0FFF1F3D |
:1013B000EE0FFF1FED59FC4F20813181240F351FA7 |
:1013C000F601EE0FFF1FEE0FFF1FEE0FFF1FEF598D |
:1013D000FC4F808191812817390790F541155105FF |
:1013E00079F18C905A010894A108B108A114B104B4 |
:1013F000C9F07601EE0CFF1CEE0CFF1CEE0CFF1C7E |
:101400008FE593E0E80EF91E8D01C0E0D0E0F80111 |
:101410006181C7010E94710321960F5F1F4FCA159A |
:10142000DB05A8F3F601E35AFC4F8FEF8083992088 |
:10143000A9F080919B0085FFFCCF80929C0011C099 |
:1014400080E0DF91CF911F910F91FF90EF90DF909F |
:10145000CF90BF90AF909F908F9008955D9BFECFEF |
:101460008CB88BE493E0C80ED91EF60110828FEF82 |
:10147000E8CF90E0880F991F880F991F880F991F58 |
:10148000815A9C4F0E9471030895682F87E693E06C |
:101490000E9471030895682F8FE593E00E94710305 |
:1014A0000895CF93DF93282FA82FB0E0ED01C35A02 |
:1014B000DC4F88818823C1F0FD01EE0FFF1FEE0F86 |
:1014C000FF1FEE0FFF1FED59FC4F80819181892B8B |
:1014D00091F02223C1F087E693E00E940A038093F3 |
:1014E0009C00DF91CF910895A55BBC4F8FEF8C934B |
:1014F000DF91CF9108951882A55BBC4F8FEF8C933D |
:10150000DF91CF9108958FE593E00E940A038CB993 |
:10151000DF91CF9108951F920F920FB60F92112471 |
:101520008F9381E00E94510A8F910F900FBE0F9010 |
:101530001F9018951F920F920FB60F9211248F9340 |
:1015400080E00E94510A8F910F900FBE0F901F9064 |
:1015500018951F93CF93DF93182FC82FD0E0FE016B |
:10156000E35AFC4F8FEF8083CE01880F991F880FBD |
:10157000991F880F991F815A9C4F0E940A03982F28 |
:10158000112369F080919B0085FFFCCF90939C0014 |
:10159000C55BDC4F1882DF91CF911F9108955D9B51 |
:1015A000FECF9CB9C55BDC4F1882DF91CF911F91B4 |
:1015B0000895CF93DF93EB01282F30E0F901EE0F70 |
:1015C000FF1FEE0FFF1FEE0FFF1FE15BFC4F80813F |
:1015D0009181892B69F0F901EE0FFF1FEE0FFF1FBC |
:1015E000EE0FFF1FEF5AFC4F80819181892B21F470 |
:1015F00080E0DF91CF910895220F331F220F331F18 |
:10160000220F331FC901835B9C4F0E940A0388830A |
:101610008FEFDF91CF910895DF93CF930F92CDB7E6 |
:10162000DEB7BE016F5F7F4F81E00E94D90A882339 |
:1016300041F08981282F30E0C9010F90CF91DF91CF |
:1016400008952FEF3FEFC9010F90CF91DF910895DB |
:10165000DF93CF930F92CDB7DEB7BE016F5F7F4FA1 |
:1016600080E00E94D90A882341F08981282F30E048 |
:10167000C9010F90CF91DF9108952FEF3FEFC9017E |
:101680000F90CF91DF91089590E0880F991F880FF8 |
:10169000991F880F991F835B9C4F0E94A703089591 |
:1016A00040E850E06AEA72E085E593E00E94FD02BE |
:1016B00040E150E06AE273E087E693E00E94FD02B9 |
:1016C00008950E94500B10923D0310923C0388ED48 |
:1016D00080939A0040E855E260E070E081E00E946B |
:1016E000EC088FEF80934C0310925E03109272030C |
:1016F000109271037894089540E850E06AE172E036 |
:101700008DE493E00E94FD0240E150E06AE972E05E |
:101710008FE593E00E94FD0208950E947C0B1092D9 |
:101720003B0310923A0388ED8AB940E855E260E045 |
:1017300070E080E00E94EC088FEF80934B031092E2 |
:101740005D031092700310926F03789408950E94C5 |
:101750008D0B0E94610B0895EF92FF920F931F93E0 |
:101760007B018C0120E030E040E05FE40E94230F29 |
:1017700088238CF020E030E040E05FE4C801B7014E |
:101780000E94210D0E94B10F9B01AC0120503040FE |
:101790004040504806C0C801B7010E94B10F9B01EC |
:1017A000AC01B901CA011F910F91FF90EF9008950C |
:1017B000A0E0B0E0EEEDFBE00C94DC12DC012B01CC |
:1017C000FA019C91923008F436C1EB018881823095 |
:1017D00008F430C1943061F4843009F02CC1FD016B |
:1017E00091818981981709F426C1A0E0B1E023C155 |
:1017F000843009F41FC18230A9F4923009F01BC172 |
:101800009A01AD0188E0EA010990AE01E90109926F |
:101810009E018150C1F7E2018981ED0199818923FF |
:10182000818306C1923009F405C1ED012A803B8015 |
:10183000EB018A819B81ED01AC80BD80CE80DF8091 |
:10184000EB01EC80FD800E811F819101281B390B7B |
:10185000B90137FF04C066277727621B730B60321C |
:1018600071050CF061C0121613066CF537014801C2 |
:10187000062E04C096948794779467940A94D2F7BE |
:1018800021E030E040E050E004C0220F331F441F4D |
:10189000551F6A95D2F721503040404050402E21CC |
:1018A0003F2140235123211531054105510521F0E8 |
:1018B00021E030E040E050E079018A01E628F72895 |
:1018C000082919293CC0232BD1F1260E371E3501DA |
:1018D0004601062E04C096948794779467940A94E0 |
:1018E000D2F721E030E040E050E004C0220F331F87 |
:1018F000441F551F6A95D2F7215030404040504058 |
:101900002A213B214C215D2121153105410551053D |
:1019100021F021E030E040E050E059016A01A628C2 |
:10192000B728C828D9280BC0821593052CF01C01B4 |
:10193000AA24BB24650103C0EE24FF248701ED0126 |
:101940009981E2018981981709F445C0992339F0FA |
:10195000A80197012A193B094C095D0906C0A60197 |
:1019600095012E193F09400B510B57FD08C01182FC |
:101970003382228224833583468357831DC081E0CE |
:1019800081833382228288279927DC01821B930B73 |
:10199000A40BB50B84839583A683B7830DC0220F58 |
:1019A000331F441F551F2483358346835783828109 |
:1019B0009381019793838283248135814681578166 |
:1019C000DA01C9010197A109B1098F5F9F4FAF4F9C |
:1019D000BF4328F30BC0918333822282EA0CFB1CA5 |
:1019E0000C1D1D1DE482F5820683178383E080832E |
:1019F000248135814681578157FF1AC0C901AA2722 |
:101A000097FDA095BA2F81709070A070B070569518 |
:101A1000479537952795822B932BA42BB52B848341 |
:101A20009583A683B7838281938101969383828372 |
:101A3000DF0101C0D201CD01CDB7DEB7E2E10C94E8 |
:101A4000F812A0E2B0E0E7E2FDE00C94E81269834E |
:101A50007A838B839C832D833E834F835887E9E071 |
:101A6000EE2EF12CEC0EFD1EB701CE0101960E9468 |
:101A7000A2118E010F5E1F4FB801CE0105960E9484 |
:101A8000A2118A8991E089278A8BAE01475E5F4F58 |
:101A9000B801C7010E94D80B0E94CD10A096E6E0C5 |
:101AA0000C940413A0E2B0E0E8E5FDE00C94E81229 |
:101AB00069837A838B839C832D833E834F835887EE |
:101AC000F9E0EF2EF12CEC0EFD1EB701CE010196D0 |
:101AD0000E94A2118E010F5E1F4FB801CE01059624 |
:101AE0000E94A211AE01475E5F4FB801C7010E947C |
:101AF000D80B0E94CD10A096E6E00C940413A0E24F |
:101B0000B0E0E5E8FDE00C94DC1269837A838B8316 |
:101B10009C832D833E834F835887BE01675F7F4F31 |
:101B2000CE0101960E94A211BE016F5E7F4FCE01D1 |
:101B300005960E94A2119985923088F08989823099 |
:101B4000C8F0943019F4823051F404C0843029F480 |
:101B5000923081F480E091E0C6C0923049F420E0F8 |
:101B60009A858A89981321E02A87CE010996BBC0FD |
:101B7000823049F420E09A858A89981321E02A8BE3 |
:101B8000CE014196B0C02D843E844F8458886D8824 |
:101B90007E888F88988CEE24FF248701AA24BB249A |
:101BA000650140E050E060E070E0E0E0F0E0C1019D |
:101BB00081709070892BE9F0E60CF71C081D191D47 |
:101BC0009A01AB012A0D3B1D4C1D5D1D80E090E08C |
:101BD000A0E0B0E0E614F7040805190520F481E060 |
:101BE00090E0A0E0B0E0BA01A901480F591F6A1FB8 |
:101BF0007B1FAA0CBB1CCC1CDD1C97FE08C081E01F |
:101C000090E0A0E0B0E0A82AB92ACA2ADB2A3196DF |
:101C1000E032F10549F0660C771C881C991C56943B |
:101C2000479437942794C3CFFA85EA892B893C8956 |
:101C30008B859C85280F391F2E5F3F4F17C0CA0127 |
:101C400081709070892B61F016950795F794E79451 |
:101C500080E090E0A0E0B0E8E82AF92A0A2B1B2BEC |
:101C600076956795579547952F5F3F4F77FDE7CF5F |
:101C70000CC0440F551F661F771F17FD4160EE0C07 |
:101C8000FF1C001F111F21503040403090E05907C9 |
:101C900090E0690790E4790760F32B8F3C8FDB01BC |
:101CA000CA018F779070A070B07080349105A10543 |
:101CB000B10561F447FD0AC0E114F1040105110505 |
:101CC00029F0405C5F4F6F4F7F4F40781A8EFE17B0 |
:101CD00011F081E08A8F4D8F5E8F6F8F78A383E044 |
:101CE000898FCE0149960E94CD10A096E2E10C9416 |
:101CF000F812A8E1B0E0EFE7FEE00C94E41269838B |
:101D00007A838B839C832D833E834F835887B9E0EE |
:101D1000EB2EF12CEC0EFD1EB701CE0101960E94B8 |
:101D2000A2118E010F5E1F4FB801CE0105960E94D1 |
:101D3000A2112985223008F47CC03989323010F490 |
:101D4000B8017AC08A859A8989278A87243011F058 |
:101D5000223031F4231709F06CC060E071E06CC0F0 |
:101D6000343039F41D861E861F86188A1C861B8611 |
:101D700004C0323021F484E08987B7015DC02B852F |
:101D80003C858B899C89281B390B3C872B87ED84EC |
:101D9000FE840F851889AD88BE88CF88D88CEA1458 |
:101DA000FB040C051D0540F4EE0CFF1C001F111F69 |
:101DB000215030403C872B8720E030E040E050E06D |
:101DC00080E090E0A0E0B0E46FE170E0EA14FB0492 |
:101DD0000C051D0540F0282B392B4A2B5B2BEA18EC |
:101DE000FB080C091D09B695A79597958795EE0CEC |
:101DF000FF1C001F111F6150704041F7DA01C9013B |
:101E00008F779070A070B07080349105A105B105F6 |
:101E100061F427FD0AC0E114F1040105110529F060 |
:101E2000205C3F4F4F4F5F4F20782D873E874F8775 |
:101E3000588BBE01675F7F4FCB010E94CD10689623 |
:101E4000EAE00C940013A8E1B0E0E9E2FFE00C94B2 |
:101E5000E81269837A838B839C832D833E834F832F |
:101E6000588789E0E82EF12CEC0EFD1EB701CE015B |
:101E700001960E94A2118E010F5E1F4FB801CE0184 |
:101E800005960E94A2118985823040F089898230AE |
:101E900028F0B801C7010E94121201C08FEF6896A6 |
:101EA000E6E00C940413A8E0B0E0E9E5FFE00C9450 |
:101EB000E5129B01AC0183E08983DA01C90188271F |
:101EC000B7FD83959927AA27BB27B82E2115310581 |
:101ED0004105510519F482E089833AC08823A9F0AD |
:101EE000203080E0380780E0480780E8580729F470 |
:101EF00060E070E080E09FEC30C0EE24FF248701BA |
:101F0000E21AF30A040B150B02C079018A018EE173 |
:101F1000C82ED12CDC82CB82ED82FE820F83188703 |
:101F2000C801B7010E947E1001971816190684F4A3 |
:101F3000082E04C0EE0CFF1C001F111F0A94D2F7DC |
:101F4000ED82FE820F831887C81AD90ADC82CB8201 |
:101F5000BA82CE0101960E94CD102896E9E00C9439 |
:101F60000113ACE0B0E0E7EBFFE00C94EC12698306 |
:101F70007A838B839C83BE016B5F7F4FCE0101967A |
:101F80000E94A2118D81823061F1823050F1843043 |
:101F900021F48E81882351F12EC02F81388537FDA1 |
:101FA00020C06E812F3131051CF06623F9F023C06B |
:101FB0008EE190E0821B930B29853A854B855C85E9 |
:101FC00004C056954795379527958A95D2F766238D |
:101FD000B1F050954095309521953F4F4F4F5F4F51 |
:101FE0000EC020E030E040E050E009C02FEF3FEFAE |
:101FF0004FEF5FE704C020E030E040E050E8B90177 |
:10200000CA012C96E2E00C940813A8E0B0E0EBE0E3 |
:10201000F0E10C94E6127B018C01611571058105DC |
:10202000910519F482E0898360C083E089838EE1A1 |
:10203000C82ED12CDC82CB82ED82FE820F831887E2 |
:10204000C801B7010E947E10BC016150704077FF4B |
:1020500039C0EE27FF27E61BF70B20E030E040E019 |
:1020600050E081E090E0A0E0B0E00E2E04C0880FC8 |
:10207000991FAA1FBB1F0A94D2F70197A109B109A2 |
:102080008E219F21A023B1230097A105B10521F046 |
:1020900021E030E040E050E004C016950795F79449 |
:1020A000E794EA95D2F72E293F29402B512B2D8317 |
:1020B0003E834F8358878EE190E0861B970B9C836D |
:1020C0008B8313C06115710581F0062E04C0EE0CE0 |
:1020D000FF1C001F111F0A94D2F7ED82FE820F83AE |
:1020E0001887C61AD70ADC82CB821A82CE010196E3 |
:1020F0000E94CD102896E8E00C940213EF92FF9214 |
:102100000F931F937B018C0180E0E81680E0F806B6 |
:1021100081E0080780E0180788F48FEFE816F104E3 |
:102120000105110531F028F088E090E0A0E0B0E072 |
:1021300017C080E090E0A0E0B0E012C080E0E816B8 |
:1021400080E0F80680E0080781E0180728F088E1C1 |
:1021500090E0A0E0B0E004C080E190E0A0E0B0E05A |
:1021600020E230E040E050E0281B390B4A0B5B0BCB |
:1021700004C016950795F794E7948A95D2F7F7016E |
:10218000E85FFE4F8081281B310941095109C901CF |
:102190001F910F91FF90EF900895DF92EF92FF92C1 |
:1021A0000F931F93FC01E480F58006811781D18095 |
:1021B0008081823048F480E090E0A0E1B0E0E82A3D |
:1021C000F92A0A2B1B2BA5C0843009F49FC082304A |
:1021D00021F4EE24FF24870105C0E114F104010578 |
:1021E000110519F4E0E0F0E096C0628173819FEF81 |
:1021F000623879070CF05BC022E83FEF261B370BF3 |
:102200002A3131052CF020E030E040E050E02AC0D7 |
:10221000B801A701022E04C076956795579547959A |
:102220000A94D2F781E090E0A0E0B0E004C0880F0B |
:10223000991FAA1FBB1F2A95D2F70197A109B109BF |
:102240008E219F21A023B1230097A105B10521F084 |
:1022500081E090E0A0E0B0E09A01AB01282B392B9F |
:102260004A2B5B2BDA01C9018F779070A070B07098 |
:1022700080349105A105B10539F427FF09C0205C20 |
:102280003F4F4F4F5F4F04C0215C3F4F4F4F5F4F59 |
:10229000E0E0F0E02030A0E03A07A0E04A07A0E448 |
:1022A0005A0710F0E1E0F0E079018A0127C06038B8 |
:1022B000710564F5FB01E158FF4FD801C7018F7725 |
:1022C0009070A070B07080349105A105B10539F40B |
:1022D000E7FE0DC080E490E0A0E0B0E004C08FE332 |
:1022E00090E0A0E0B0E0E80EF91E0A1F1B1F17FFE8 |
:1022F00005C016950795F794E794319687E01695F3 |
:102300000795F794E7948A95D1F705C0EE24FF244A |
:102310008701EFEFF0E06E2F679566276795902FA6 |
:102320009F77D794DD24D7948E2F8695492F462BFF |
:10233000582F5D29B701CA011F910F91FF90EF90AF |
:10234000DF900895FC01DB01408151812281622FE1 |
:102350006F7770E0221F2227221F9381892F880F19 |
:10236000822B282F30E0991F9927991FFD01918317 |
:102370002115310581F5411551056105710511F4EE |
:1023800082E032C082E89FEFFD01938382839A014D |
:10239000AB0167E0220F331F441F551F6A95D1F729 |
:1023A00083E08C930AC0220F331F441F551FFD0189 |
:1023B000828193810197938382832030F0E03F07ED |
:1023C000F0E04F07F0E45F0770F3FD0124833583ED |
:1023D0004683578308952F3F310581F441155105F8 |
:1023E0006105710519F484E08C93089564FF03C0BE |
:1023F00081E08C9301C01C92FD010FC02F5730402B |
:10240000FD013383228383E08C9387E0440F551FC3 |
:10241000661F771F8A95D1F770644483558366835E |
:10242000778308951F93CF93DF93DC01FB019C9189 |
:10243000923008F444C08081823008F440C0943067 |
:1024400051F4ED011981843081F58181682F70E0AC |
:10245000611B71093CC0843021F0923031F482302C |
:10246000A1F18181882371F12AC0ED0119818230A7 |
:10247000E1F081811817C9F4ED012A813B81828145 |
:102480009381821793078CF028173907B4F0ED0178 |
:102490008C819D81AE81BF812481358146815781A8 |
:1024A000281739074A075B0718F4112341F00AC0BF |
:1024B00082179307A407B50740F4112319F061E0D0 |
:1024C00070E005C06FEF7FEF02C060E070E0CB010D |
:1024D000DF91CF911F910895629FD001739FF0010A |
:1024E000829FE00DF11D649FE00DF11D929FF00DA4 |
:1024F000839FF00D749FF00D659FF00D9927729FDB |
:10250000B00DE11DF91F639FB00DE11DF91FBD0165 |
:10251000CF0111240895AA1BBB1B51E107C0AA1FBC |
:10252000BB1FA617B70710F0A61BB70B881F991F74 |
:102530005A95A9F780959095BC01CD010895A1E227 |
:102540001A2EAA1BBB1BFD010DC0AA1FBB1FEE1F2D |
:10255000FF1FA217B307E407F50720F0A21BB30B78 |
:10256000E40BF50B661F771F881F991F1A9469F7F4 |
:1025700060957095809590959B01AC01BD01CF0150 |
:10258000089597FB092E05260ED057FD04D0D7DFFE |
:102590000AD0001C38F450954095309521953F4F56 |
:1025A0004F4F5F4F0895F6F7909580957095619520 |
:1025B0007F4F8F4F9F4F08952F923F924F925F9280 |
:1025C0006F927F928F929F92AF92BF92CF92DF9243 |
:1025D000EF92FF920F931F93CF93DF93CDB7DEB7A8 |
:1025E000CA1BDB0B0FB6F894DEBF0FBECDBF09943C |
:1025F0002A88398848885F846E847D848C849B8493 |
:10260000AA84B984C884DF80EE80FD800C811B81A0 |
:10261000AA81B981CE0FD11D0FB6F894DEBF0FBECF |
:10262000CDBFED010895F5D058F080E891E009F4B0 |
:102630009EEFF6D028F040E851E059F45EEF09C073 |
:10264000C0C028C1E92FE07803D168F3092E052A1C |
:10265000C1F3261737074807590738F00E2E07F839 |
:10266000E02569F0E025E0640AC0EF6307F8009414 |
:1026700007FADB01B9019D01DC01CA01AD01EF934D |
:1026800041D0D5D00AD05F91552331F02BED3FE0FA |
:1026900049E450FD49EC06CA0895DF93DD27B92FC0 |
:1026A000BF7740E85FE31616170648075B0710F48C |
:1026B000D92FF7D09F938F937F936F93C8D1ECE876 |
:1026C000F0E082D0B4D02F913F914F915F91FAD03A |
:1026D000DD2349F09058A2EA2AED3FE049EC5FE3A0 |
:1026E000D0785D27CBD1DF91A2C09AD040F091D0B5 |
:1026F00030F021F45F3F19F05EC05111CCC061C0D1 |
:10270000A7D098F39923C9F35523B1F3951B550B23 |
:10271000BB27AA2762177307840738F09F5F5F4FB4 |
:10272000220F331F441FAA1FA9F333D00E2E3AF0F5 |
:10273000E0E830D091505040E695001CCAF729D00F |
:10274000FE2F27D0660F771F881FBB1F261737075E |
:102750004807AB07B0E809F0BB0B802DBF01FF278E |
:1027600093585F4F2AF09E3F510568F024C093C0F4 |
:102770005F3FECF3983EDCF3869577956795B795C8 |
:10278000F7959F5FC9F7880F911D9695879597F9E3 |
:102790000895E1E0660F771F881FBB1F621773075C |
:1027A0008407BA0720F0621B730B840BBA0BEE1F71 |
:1027B00088F7E095089597F99F6780E870E060E0FA |
:1027C00008959FEF80EC0895DF93CF931F930F93AD |
:1027D000FF92EF92DF927B018C01689405C0DA2EA4 |
:1027E000EF0170D0FE01E894A591259135914591B6 |
:1027F0005591AEF3EF0142D1FE019701A801DA94A1 |
:1028000079F7DF90EF90FF900F911F91CF91DF91BB |
:10281000089500240A941616170618060906089546 |
:1028200000240A9412161306140605060895092EAC |
:102830000394000C11F4882352F0BB0F40F4BF2B1B |
:1028400011F460FF04C06F5F7F4F8F4F9F4F08955B |
:1028500057FD9058440F551F59F05F3F71F0479551 |
:10286000880F97FB991F61F09F3F79F08795089536 |
:10287000121613061406551FF2CF4695F1DF08C055 |
:10288000161617061806991FF1CF86957105610572 |
:1028900008940895E894BB2766277727CB0197F91A |
:1028A00008959B01AC0160E070E080E89FE321CADD |
:1028B000B0DF28F0B5DF18F0952309F07CCF81CF89 |
:1028C0001124E9CFC5DFA0F3959FD1F3950F50E018 |
:1028D000551F629FF001729FBB27F00DB11D639FD2 |
:1028E000AA27F00DB11DAA1F649F6627B00DA11D78 |
:1028F000661F829F2227B00DA11D621F739FB00D1E |
:10290000A11D621F839FA00D611D221F749F33278D |
:10291000A00D611D231F849F600D211D822F762F26 |
:102920006A2F11249F5750408AF0E1F088234AF023 |
:10293000EE0FFF1FBB1F661F771F881F915050406F |
:10294000A9F79E3F510570F036CFA5CF5F3FECF35E |
:10295000983EDCF3869577956795B795F795E7955B |
:102960009F5FC1F7FE2B880F911D9695879597F96C |
:10297000089576DFE0F09E37D8F09639B8F49E38A7 |
:1029800048F4672F782F8827985FF9CF8695779539 |
:10299000679593959539D0F3B62FB1706B0F711D74 |
:1029A000811D20F48795779567959395BAC0D4C01B |
:1029B00072CF11F40EF405CFCFC052DFD0F39923BC |
:1029C000D9F3CEF39F57550B87FFD6D056959795E1 |
:1029D000B0E020F4660F771F881FBB1F1F930F9373 |
:1029E00000249001A0018001F001A0E80E0F1F1F3C |
:1029F0000A1E511D601B710B8009B50B48F4600F56 |
:102A0000711F801DB51F0E1B1F0B0A0A510907C03D |
:102A10002E0F3F1F4A1F0E0F1F1F0A1E511D660F4C |
:102A2000771F881FBB1FA695F795E795F8F6061741 |
:102A3000170708065B07211D311D411D0F911F91CE |
:102A4000B901842F9158880F9695879508959B0119 |
:102A5000AC0155C898D020F09F3708F41CCF61C056 |
:102A60007BC0D7DE30F0DCDE20F031F49F3F11F484 |
:102A70001EF4A7CE0EF4E095E7FB9DCEE92FE8DE2D |
:102A800080F3BA17620773078407950718F071F48B |
:102A90009EF500CF0EF4E0950B2EBA2FA02D0B0162 |
:102AA000B90190010C01CA01A0011124FF27591B93 |
:102AB00099F0593F50F4503E68F11A16F040A22F99 |
:102AC000232F342F4427585FF3CF4695379527950A |
:102AD000A795F0405395C9F77EF41F16BA0B620B09 |
:102AE000730B840BBAF09150A1F0FF0FBB1F661F50 |
:102AF000771F881FC2F70EC0BA0F621F731F841F93 |
:102B000048F4879577956795B795F7959E3F08F0B8 |
:102B1000B3CF9395880F08F09927EE0F9795879577 |
:102B20000895882371F4772321F09850872B762F0E |
:102B300007C0662311F499270DC09051862B70E0D1 |
:102B400060E02AF09A95660F771F881FDAF7880FE2 |
:102B50009695879597F908959F3F49F0915028F4ED |
:102B6000869577956795B7959F5F80389F4F880FBB |
:102B70009695879597F9089591505040660F771F65 |
:102B8000881FD2F708956CDEA0F0BEE7B91788F46D |
:102B9000BB279F3860F41616B11D672F782F882742 |
:102BA000985FF7CF869577956795B11D9395963980 |
:082BB000C8F30895F894FFCF6B |
:102BB80000000000000000000001020203030303FC |
:102BC80004040404040404040505050505050505B5 |
:102BD8000505050505050505060606060606060695 |
:102BE800060606060606060606060606060606067D |
:102BF8000606060606060606070707070707070765 |
:102C0800070707070707070707070707070707074C |
:102C1800070707070707070707070707070707073C |
:102C2800070707070707070707070707070707072C |
:102C38000707070707070707080808080808080814 |
:102C480008080808080808080808080808080808FC |
:102C580008080808080808080808080808080808EC |
:102C680008080808080808080808080808080808DC |
:102C780008080808080808080808080808080808CC |
:102C880008080808080808080808080808080808BC |
:102C980008080808080808080808080808080808AC |
:102CA800080808080808080808080808080808089C |
:082CB8000808080808080808D4 |
:00000001FF |
/programy/C/avr/inclinometer/project.map |
---|
0,0 → 1,827 |
Archive member included because of file (symbol) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_mulsi3.o) |
timer.o (__mulsi3) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodhi4.o) |
buffer.o (__udivmodhi4) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodsi4.o) |
rprintf.o (__udivmodsi4) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_divmodsi4.o) |
timer.o (__divmodsi4) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_exit.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o (exit) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_copy_data.o) |
a2dtest.o (__do_copy_data) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clear_bss.o) |
a2dtest.o (__do_clear_bss) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fixunssfsi.o) |
a2dtest.o (__fixunssfsi) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_addsub_sf.o) |
a2dtest.o (__subsf3) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_mul_sf.o) |
a2dtest.o (__mulsf3) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_div_sf.o) |
a2dtest.o (__divsf3) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_ge_sf.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fixunssfsi.o) (__gesf2) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_si_to_sf.o) |
a2dtest.o (__floatsisf) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_sf_to_si.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fixunssfsi.o) (__fixsfsi) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_thenan_sf.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_addsub_sf.o) (__thenan_sf) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_usi_to_sf.o) |
a2dtest.o (__floatunsisf) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_prologue.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_addsub_sf.o) (__prologue_saves__) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_epilogue.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_addsub_sf.o) (__epilogue_restores__) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clzsi2.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_si_to_sf.o) (__clzsi2) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_pack_sf.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_addsub_sf.o) (__pack_f) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_unpack_sf.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_addsub_sf.o) (__unpack_f) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fpcmp_parts_sf.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_ge_sf.o) (__fpcmp_parts_f) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clz.o) |
/usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clzsi2.o) (__clz_tab) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) |
a2dtest.o (atan2) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) (atan) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(divsf3x.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) (__divsf3_pse) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_inf.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(divsf3x.o) (__fp_inf) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_nan.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) (__fp_nan) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_powser.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) (__fp_powser) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscA.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) (__fp_pscA) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscB.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) (__fp_pscB) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_round.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) (__fp_round) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_split3.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) (__fp_split3) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_zero.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) (__fp_zero) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(inverse.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) (inverse) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(mulsf3x.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) (__mulsf3x) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(round.o) |
a2dtest.o (round) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(sqrt.o) |
a2dtest.o (sqrt) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(square.o) |
a2dtest.o (square) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(trunc.o) |
a2dtest.o (trunc) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(addsf3x.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) (__addsf3x) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mintl.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(round.o) (__fp_mintl) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mpack.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(round.o) (__fp_mpack) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_norm2.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(sqrt.o) (__fp_norm2) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_trunc.o) |
/usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(trunc.o) (__fp_trunc) |
Allocating common symbols |
Common symbol size file |
uartReadyTx 0x2 uart2.o |
Timer0Reg0 0x4 timer.o |
uartRxBuffer 0x10 uart2.o |
TimerPauseReg 0x4 timer.o |
Timer2Reg0 0x4 timer.o |
uartBufferedTx 0x2 uart2.o |
a2dCompleteFlag 0x1 a2d.o |
uartTxBuffer 0x10 uart2.o |
uartRxOverflow 0x4 uart2.o |
Memory Configuration |
Name Origin Length Attributes |
text 0x00000000 0x00020000 xr |
data 0x00800060 0x0000ffa0 rw !x |
eeprom 0x00810000 0x00010000 rw !x |
fuse 0x00820000 0x00000400 rw !x |
lock 0x00830000 0x00000400 rw !x |
signature 0x00840000 0x00000400 rw !x |
*default* 0x00000000 0xffffffff |
Linker script and memory map |
Address of section .data set to 0x800100 |
LOAD /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
LOAD a2dtest.o |
LOAD a2d.o |
LOAD buffer.o |
LOAD rprintf.o |
LOAD timer.o |
LOAD uart2.o |
LOAD /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a |
LOAD /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a |
LOAD /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a |
.hash |
*(.hash) |
.dynsym |
*(.dynsym) |
.dynstr |
*(.dynstr) |
.gnu.version |
*(.gnu.version) |
.gnu.version_d |
*(.gnu.version_d) |
.gnu.version_r |
*(.gnu.version_r) |
.rel.init |
*(.rel.init) |
.rela.init |
*(.rela.init) |
.rel.text |
*(.rel.text) |
*(.rel.text.*) |
*(.rel.gnu.linkonce.t*) |
.rela.text |
*(.rela.text) |
*(.rela.text.*) |
*(.rela.gnu.linkonce.t*) |
.rel.fini |
*(.rel.fini) |
.rela.fini |
*(.rela.fini) |
.rel.rodata |
*(.rel.rodata) |
*(.rel.rodata.*) |
*(.rel.gnu.linkonce.r*) |
.rela.rodata |
*(.rela.rodata) |
*(.rela.rodata.*) |
*(.rela.gnu.linkonce.r*) |
.rel.data |
*(.rel.data) |
*(.rel.data.*) |
*(.rel.gnu.linkonce.d*) |
.rela.data |
*(.rela.data) |
*(.rela.data.*) |
*(.rela.gnu.linkonce.d*) |
.rel.ctors |
*(.rel.ctors) |
.rela.ctors |
*(.rela.ctors) |
.rel.dtors |
*(.rel.dtors) |
.rela.dtors |
*(.rela.dtors) |
.rel.got |
*(.rel.got) |
.rela.got |
*(.rela.got) |
.rel.bss |
*(.rel.bss) |
.rela.bss |
*(.rela.bss) |
.rel.plt |
*(.rel.plt) |
.rela.plt |
*(.rela.plt) |
.text 0x00000000 0x2bb8 |
*(.vectors) |
.vectors 0x00000000 0x8c /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
0x00000000 __vectors |
0x00000000 __vector_default |
*(.vectors) |
*(.progmem.gcc*) |
.progmem.gcc_fplib |
0x0000008c 0x2d /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) |
*(.progmem*) |
.progmem.data 0x000000b9 0x2f a2dtest.o |
.progmem.data 0x000000e8 0x11 rprintf.o |
.progmem.data 0x000000f9 0x1c timer.o |
0x00000105 TimerRTCPrescaleFactor |
0x000000f9 TimerPrescaleFactor |
0x00000116 . = ALIGN (0x2) |
*fill* 0x00000115 0x1 00 |
0x00000116 __trampolines_start = . |
*(.trampolines) |
.trampolines 0x00000116 0x0 linker stubs |
*(.trampolines*) |
0x00000116 __trampolines_end = . |
*(.jumptables) |
*(.jumptables*) |
*(.lowtext) |
*(.lowtext*) |
0x00000116 __ctors_start = . |
*(.ctors) |
0x00000116 __ctors_end = . |
0x00000116 __dtors_start = . |
*(.dtors) |
0x00000116 __dtors_end = . |
SORT(*)(.ctors) |
SORT(*)(.dtors) |
*(.init0) |
.init0 0x00000116 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
0x00000116 __init |
*(.init0) |
*(.init1) |
*(.init1) |
*(.init2) |
.init2 0x00000116 0xc /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
*(.init2) |
*(.init3) |
*(.init3) |
*(.init4) |
.init4 0x00000122 0x16 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_copy_data.o) |
0x00000122 __do_copy_data |
.init4 0x00000138 0x10 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clear_bss.o) |
0x00000138 __do_clear_bss |
*(.init4) |
*(.init5) |
*(.init5) |
*(.init6) |
*(.init6) |
*(.init7) |
*(.init7) |
*(.init8) |
*(.init8) |
*(.init9) |
.init9 0x00000148 0x8 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
*(.init9) |
*(.text) |
.text 0x00000150 0x4 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
0x00000150 __vector_22 |
0x00000150 __vector_28 |
0x00000150 __vector_1 |
0x00000150 __vector_34 |
0x00000150 __vector_24 |
0x00000150 __bad_interrupt |
0x00000150 __vector_6 |
0x00000150 __vector_31 |
0x00000150 __vector_3 |
0x00000150 __vector_23 |
0x00000150 __vector_25 |
0x00000150 __vector_17 |
0x00000150 __vector_19 |
0x00000150 __vector_7 |
0x00000150 __vector_27 |
0x00000150 __vector_5 |
0x00000150 __vector_33 |
0x00000150 __vector_4 |
0x00000150 __vector_2 |
0x00000150 __vector_29 |
0x00000150 __vector_8 |
0x00000150 __vector_26 |
.text 0x00000154 0x3f8 a2dtest.o |
0x000002fc main |
0x00000240 radtodeg |
0x00000154 quadraticerror |
.text 0x0000054c 0xae a2d.o |
0x000005a0 a2dIsComplete |
0x000005ce a2dConvert8bit |
0x0000056c a2dOff |
0x00000572 a2dSetPrescaler |
0x000005a6 a2dConvert10bit |
0x0000054c a2dInit |
0x0000057c a2dSetReference |
0x000005dc __vector_21 |
0x0000058e a2dSetChannel |
0x0000059a a2dStartConvert |
.text 0x000005fa 0x162 buffer.o |
0x00000736 bufferIsNotFull |
0x00000614 bufferGetFromFront |
0x000006ba bufferGetAtIndex |
0x00000678 bufferDumpFromFront |
0x000005fa bufferInit |
0x000006e2 bufferAddToEnd |
0x0000074e bufferFlush |
.text 0x0000075c 0x468 rprintf.o |
0x00000a46 rprintf1RamRom |
0x0000086a rprintfu08 |
0x00000894 rprintfu32 |
0x0000079a rprintfStr |
0x000007b8 rprintfStrLen |
0x00000824 rprintfProgStr |
0x00000880 rprintfu16 |
0x0000075c rprintfInit |
0x00000766 rprintfChar |
0x0000084c rprintfCRLF |
0x00000854 rprintfu04 |
0x000008ba rprintfNum |
.text 0x00000bc4 0x5fc timer.o |
0x00000e7e timer2GetOverflowCount |
0x00000d10 timerDetach |
0x00000c98 timer1SetPrescaler |
0x000010d8 __vector_12 |
0x00000f54 timer1PWMBOff |
0x00000ce0 timer2GetPrescaler |
0x00000c36 timer0Init |
0x00000f46 timer1PWMAOff |
0x00000f68 timer1PWMBSet |
0x0000114c __vector_11 |
0x00000ede timer1PWMInitICR |
0x00001112 __vector_13 |
0x00000cac timer0GetPrescaler |
0x00000e56 timer0GetOverflowCount |
0x00000bc6 timerInit |
0x00000ca2 timer2SetPrescaler |
0x00000f2a timer1PWMAOn |
0x00000c8e timer0SetPrescaler |
0x00000bc4 delay_us |
0x00000e44 timer0ClearOverflowCount |
0x00001186 __vector_9 |
0x00000c58 timer1Init |
0x0000109e __vector_15 |
0x00000e94 timer1PWMInit |
0x00000f38 timer1PWMBOn |
0x00000c6c timer2Init |
0x00000f62 timer1PWMASet |
0x00000cfa timerAttach |
0x00000f04 timer1PWMOff |
0x00000ffc __vector_14 |
0x00001036 __vector_10 |
0x00000f6e __vector_16 |
0x00000cc6 timer1GetPrescaler |
0x00000e6c timer2ClearOverflowCount |
0x00000d26 timerPause |
.text 0x000011c0 0x598 uart2.o |
0x00001552 uartSendTxBuffer |
0x00001516 __vector_32 |
0x000012e6 uartReceiveService |
0x00001276 uartSendByte |
0x000016f8 uart0InitBuffers |
0x00001618 uart1GetByte |
0x000015b2 uartReceiveByte |
0x00001386 uartSendBuffer |
0x0000134a __vector_30 |
0x00001650 uart0GetByte |
0x00001472 uartAddToTxBuffer |
0x000014a2 uartTransmitService |
0x000011c0 uartSetRxHandler |
0x0000171a uart0Init |
0x000016c2 uart1Init |
0x00001688 uartFlushReceiveBuffer |
0x0000174e uartInit |
0x000012a2 uart0SendByte |
0x000012c2 uartReceiveBufferIsEmpty |
0x000011d8 uartSetBaudRate |
0x000012ae uart1SendByte |
0x0000125e uartGetTxBuffer |
0x00001246 uartGetRxBuffer |
0x000016a0 uart1InitBuffers |
0x00001496 uart0AddToTxBuffer |
0x00001368 __vector_18 |
0x0000148a uart1AddToTxBuffer |
0x00001534 __vector_20 |
.text 0x00001758 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_mulsi3.o) |
.text 0x00001758 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodhi4.o) |
.text 0x00001758 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodsi4.o) |
.text 0x00001758 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_divmodsi4.o) |
.text 0x00001758 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_exit.o) |
.text 0x00001758 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_copy_data.o) |
.text 0x00001758 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clear_bss.o) |
.text 0x00001758 0x58 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fixunssfsi.o) |
0x00001758 __fixunssfsi |
.text 0x000017b0 0x34e /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_addsub_sf.o) |
0x00001a42 __subsf3 |
0x00001aa4 __addsf3 |
.text 0x00001afe 0x1f4 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_mul_sf.o) |
0x00001afe __mulsf3 |
.text 0x00001cf2 0x154 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_div_sf.o) |
0x00001cf2 __divsf3 |
.text 0x00001e46 0x60 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_ge_sf.o) |
0x00001e46 __gesf2 |
.text 0x00001ea6 0xbc /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_si_to_sf.o) |
0x00001ea6 __floatsisf |
.text 0x00001f62 0xa8 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_sf_to_si.o) |
0x00001f62 __fixsfsi |
.text 0x0000200a 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_thenan_sf.o) |
.text 0x0000200a 0xf2 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_usi_to_sf.o) |
0x0000200a __floatunsisf |
.text 0x000020fc 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_prologue.o) |
.text 0x000020fc 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_epilogue.o) |
.text 0x000020fc 0x9e /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clzsi2.o) |
0x000020fc __clzsi2 |
.text 0x0000219a 0x1aa /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_pack_sf.o) |
0x0000219a __pack_f |
.text 0x00002344 0xe0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_unpack_sf.o) |
0x00002344 __unpack_f |
.text 0x00002424 0xb4 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fpcmp_parts_sf.o) |
0x00002424 __fpcmp_parts_f |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clz.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(divsf3x.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_inf.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_nan.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_powser.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscA.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscB.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_round.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_split3.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_zero.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(inverse.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(mulsf3x.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(round.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(sqrt.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(square.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(trunc.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(addsf3x.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mintl.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mpack.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_norm2.o) |
.text 0x000024d8 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_trunc.o) |
0x000024d8 . = ALIGN (0x2) |
*(.text.*) |
.text.libgcc 0x000024d8 0x3e /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_mulsi3.o) |
0x000024d8 __mulsi3 |
.text.libgcc 0x00002516 0x28 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodhi4.o) |
0x00002516 __udivmodhi4 |
.text.libgcc 0x0000253e 0x44 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodsi4.o) |
0x0000253e __udivmodsi4 |
.text.libgcc 0x00002582 0x36 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_divmodsi4.o) |
0x00002582 __divmodsi4 |
.text.libgcc 0x000025b8 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_exit.o) |
.text.libgcc 0x000025b8 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_copy_data.o) |
.text.libgcc 0x000025b8 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clear_bss.o) |
.text.libgcc 0x000025b8 0x38 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_prologue.o) |
0x000025b8 __prologue_saves__ |
.text.libgcc 0x000025f0 0x36 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_epilogue.o) |
0x000025f0 __epilogue_restores__ |
.text.fplib 0x00002626 0x74 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) |
0x00002644 atan2 |
.text.fplib 0x0000269a 0x50 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) |
0x0000269a atan |
.text.fplib 0x000026ea 0xcc /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(divsf3x.o) |
0x00002700 __divsf3x |
0x00002704 __divsf3_pse |
.text.fplib 0x000027b6 0xc /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_inf.o) |
0x000027b6 __fp_inf |
.text.fplib 0x000027c2 0x6 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_nan.o) |
0x000027c2 __fp_nan |
.text.fplib 0x000027c8 0x4a /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_powser.o) |
0x000027c8 __fp_powser |
.text.fplib 0x00002812 0xe /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscA.o) |
0x00002812 __fp_pscA |
.text.fplib 0x00002820 0xe /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscB.o) |
0x00002820 __fp_pscB |
.text.fplib 0x0000282e 0x22 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_round.o) |
0x0000282e __fp_round |
.text.fplib 0x00002850 0x44 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_split3.o) |
0x00002850 __fp_split3 |
0x00002860 __fp_splitA |
.text.fplib 0x00002894 0xe /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_zero.o) |
0x00002894 __fp_zero |
0x00002896 __fp_szero |
.text.fplib 0x000028a2 0xe /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(inverse.o) |
0x000028a2 inverse |
.text.fplib 0x000028b0 0xc2 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(mulsf3x.o) |
0x000028c8 __mulsf3_pse |
0x000028c4 __mulsf3x |
.text.fplib 0x00002972 0x40 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(round.o) |
0x00002972 round |
.text.fplib 0x000029b2 0x9c /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(sqrt.o) |
0x000029ba sqrt |
.text.fplib 0x00002a4e 0x6 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(square.o) |
0x00002a4e square |
.text.fplib 0x00002a54 0xe /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(trunc.o) |
0x00002a54 trunc |
.text.fplib 0x00002a62 0xc0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(addsf3x.o) |
0x00002a7c __addsf3x |
.text.fplib 0x00002b22 0x36 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mintl.o) |
0x00002b22 __fp_mintl |
.text.fplib 0x00002b58 0x20 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mpack.o) |
0x00002b58 __fp_mpack |
.text.fplib 0x00002b78 0xe /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_norm2.o) |
0x00002b78 __fp_norm2 |
.text.fplib 0x00002b86 0x2e /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_trunc.o) |
0x00002b86 __fp_trunc |
0x00002bb4 . = ALIGN (0x2) |
*(.fini9) |
.fini9 0x00002bb4 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_exit.o) |
0x00002bb4 exit |
0x00002bb4 _exit |
*(.fini9) |
*(.fini8) |
*(.fini8) |
*(.fini7) |
*(.fini7) |
*(.fini6) |
*(.fini6) |
*(.fini5) |
*(.fini5) |
*(.fini4) |
*(.fini4) |
*(.fini3) |
*(.fini3) |
*(.fini2) |
*(.fini2) |
*(.fini1) |
*(.fini1) |
*(.fini0) |
.fini0 0x00002bb4 0x4 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_exit.o) |
*(.fini0) |
0x00002bb8 _etext = . |
.data 0x00800100 0x108 load address 0x00002bb8 |
0x00800100 PROVIDE (__data_start, .) |
*(.data) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
.data 0x00800100 0x0 a2dtest.o |
.data 0x00800100 0x0 a2d.o |
.data 0x00800100 0x0 buffer.o |
.data 0x00800100 0x0 rprintf.o |
.data 0x00800100 0x0 timer.o |
.data 0x00800100 0x0 uart2.o |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_mulsi3.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodhi4.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodsi4.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_divmodsi4.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_exit.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_copy_data.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clear_bss.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fixunssfsi.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_addsub_sf.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_mul_sf.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_div_sf.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_ge_sf.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_si_to_sf.o) |
.data 0x00800100 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_sf_to_si.o) |
.data 0x00800100 0x8 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_thenan_sf.o) |
0x00800100 __thenan_sf |
.data 0x00800108 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_usi_to_sf.o) |
.data 0x00800108 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_prologue.o) |
.data 0x00800108 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_epilogue.o) |
.data 0x00800108 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clzsi2.o) |
.data 0x00800108 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_pack_sf.o) |
.data 0x00800108 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_unpack_sf.o) |
.data 0x00800108 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fpcmp_parts_sf.o) |
.data 0x00800108 0x100 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clz.o) |
0x00800108 __clz_tab |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(divsf3x.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_inf.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_nan.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_powser.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscA.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscB.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_round.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_split3.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_zero.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(inverse.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(mulsf3x.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(round.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(sqrt.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(square.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(trunc.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(addsf3x.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mintl.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mpack.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_norm2.o) |
.data 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_trunc.o) |
*(.data*) |
*(.rodata) |
*(.rodata*) |
*(.gnu.linkonce.d*) |
0x00800208 . = ALIGN (0x2) |
0x00800208 _edata = . |
0x00800208 PROVIDE (__data_end, .) |
.bss 0x00800208 0x16b load address 0x00002cc0 |
0x00800208 PROVIDE (__bss_start, .) |
*(.bss) |
.bss 0x00800208 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
.bss 0x00800208 0x0 a2dtest.o |
.bss 0x00800208 0x0 a2d.o |
.bss 0x00800208 0x0 buffer.o |
.bss 0x00800208 0x2 rprintf.o |
.bss 0x0080020a 0x10 timer.o |
.bss 0x0080021a 0x124 uart2.o |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_mulsi3.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodhi4.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_udivmodsi4.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_divmodsi4.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_exit.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_copy_data.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clear_bss.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fixunssfsi.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_addsub_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_mul_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_div_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_ge_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_si_to_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_sf_to_si.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_thenan_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_usi_to_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_prologue.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_epilogue.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clzsi2.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_pack_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_unpack_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_fpcmp_parts_sf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/avr5/libgcc.a(_clz.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(divsf3x.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_inf.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_nan.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_powser.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscA.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscB.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_round.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_split3.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_zero.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(inverse.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(mulsf3x.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(round.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(sqrt.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(square.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(trunc.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(addsf3x.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mintl.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mpack.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_norm2.o) |
.bss 0x0080033e 0x0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_trunc.o) |
*(.bss*) |
*(COMMON) |
COMMON 0x0080033e 0x1 a2d.o |
0x0080033e a2dCompleteFlag |
COMMON 0x0080033f 0xc timer.o |
0x0080033f Timer0Reg0 |
0x00800343 TimerPauseReg |
0x00800347 Timer2Reg0 |
COMMON 0x0080034b 0x28 uart2.o |
0x0080034b uartReadyTx |
0x0080034d uartRxBuffer |
0x0080035d uartBufferedTx |
0x0080035f uartTxBuffer |
0x0080036f uartRxOverflow |
0x00800373 PROVIDE (__bss_end, .) |
0x00002bb8 __data_load_start = LOADADDR (.data) |
0x00002cc0 __data_load_end = (__data_load_start + SIZEOF (.data)) |
.noinit 0x00800373 0x0 |
0x00800373 PROVIDE (__noinit_start, .) |
*(.noinit*) |
0x00800373 PROVIDE (__noinit_end, .) |
0x00800373 _end = . |
0x00800373 PROVIDE (__heap_start, .) |
.eeprom 0x00810000 0x0 |
*(.eeprom*) |
0x00810000 __eeprom_end = . |
.fuse |
*(.fuse) |
*(.lfuse) |
*(.hfuse) |
*(.efuse) |
.lock |
*(.lock*) |
.signature |
*(.signature*) |
.stab 0x00000000 0x2c94 |
*(.stab) |
.stab 0x00000000 0x6b4 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
.stab 0x000006b4 0x2f4 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan2.o) |
0x300 (size before relaxing) |
.stab 0x000009a8 0x210 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(atan.o) |
0x21c (size before relaxing) |
.stab 0x00000bb8 0x510 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(divsf3x.o) |
0x51c (size before relaxing) |
.stab 0x000010c8 0x78 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_inf.o) |
0x84 (size before relaxing) |
.stab 0x00001140 0x54 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_nan.o) |
0x60 (size before relaxing) |
.stab 0x00001194 0x1ec /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_powser.o) |
0x1f8 (size before relaxing) |
.stab 0x00001380 0x84 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscA.o) |
0x90 (size before relaxing) |
.stab 0x00001404 0x84 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_pscB.o) |
0x90 (size before relaxing) |
.stab 0x00001488 0xfc /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_round.o) |
0x108 (size before relaxing) |
.stab 0x00001584 0x1d4 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_split3.o) |
0x1e0 (size before relaxing) |
.stab 0x00001758 0x90 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_zero.o) |
0x9c (size before relaxing) |
.stab 0x000017e8 0x84 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(inverse.o) |
0x90 (size before relaxing) |
.stab 0x0000186c 0x4d4 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(mulsf3x.o) |
0x4e0 (size before relaxing) |
.stab 0x00001d40 0x1b0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(round.o) |
0x1bc (size before relaxing) |
.stab 0x00001ef0 0x3e4 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(sqrt.o) |
0x3f0 (size before relaxing) |
.stab 0x000022d4 0x54 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(square.o) |
0x60 (size before relaxing) |
.stab 0x00002328 0x84 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(trunc.o) |
0x90 (size before relaxing) |
.stab 0x000023ac 0x4bc /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(addsf3x.o) |
0x4c8 (size before relaxing) |
.stab 0x00002868 0x174 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mintl.o) |
0x180 (size before relaxing) |
.stab 0x000029dc 0xf0 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_mpack.o) |
0xfc (size before relaxing) |
.stab 0x00002acc 0x84 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_norm2.o) |
0x90 (size before relaxing) |
.stab 0x00002b50 0x144 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/libc.a(fp_trunc.o) |
0x150 (size before relaxing) |
.stabstr 0x00000000 0x442 |
*(.stabstr) |
.stabstr 0x00000000 0x442 /usr/lib/gcc/avr/4.3.0/../../../../avr/lib/avr5/crtm64.o |
.stab.excl |
*(.stab.excl) |
.stab.exclstr |
*(.stab.exclstr) |
.stab.index |
*(.stab.index) |
.stab.indexstr |
*(.stab.indexstr) |
.comment |
*(.comment) |
.debug |
*(.debug) |
.line |
*(.line) |
.debug_srcinfo |
*(.debug_srcinfo) |
.debug_sfnames |
*(.debug_sfnames) |
.debug_aranges |
*(.debug_aranges) |
.debug_pubnames |
*(.debug_pubnames) |
.debug_info |
*(.debug_info) |
*(.gnu.linkonce.wi.*) |
.debug_abbrev |
*(.debug_abbrev) |
.debug_line |
*(.debug_line) |
.debug_frame |
*(.debug_frame) |
.debug_str |
*(.debug_str) |
.debug_loc |
*(.debug_loc) |
.debug_macinfo |
*(.debug_macinfo) |
OUTPUT(project.out elf32-avr) |
LOAD linker stubs |
/programy/C/avr/inclinometer/.hfuse |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr/inclinometer/.lfuse |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programy/C/avr/inclinometer/.lock |
---|
0,0 → 1,0 |
? |
/programy/C/avr/inclinometer/a2d.c |
---|
0,0 → 1,115 |
/*! \file a2d.c \brief Analog-to-Digital converter function library. */ |
//***************************************************************************** |
// |
// File Name : 'a2d.c' |
// Title : Analog-to-digital converter functions |
// Author : Pascal Stang - Copyright (C) 2002 |
// Created : 2002-04-08 |
// Revised : 2002-09-30 |
// Version : 1.1 |
// Target MCU : Atmel AVR series |
// Editor Tabs : 4 |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
#include <avr/io.h> |
#include <avr/interrupt.h> |
#include "global.h" |
#include "a2d.h" |
// global variables |
//! Software flag used to indicate when |
/// the a2d conversion is complete. |
volatile unsigned char a2dCompleteFlag; |
// functions |
// initialize a2d converter |
void a2dInit(void) |
{ |
sbi(ADCSR, ADEN); // enable ADC (turn on ADC power) |
cbi(ADCSR, ADFR); // default to single sample convert mode |
a2dSetPrescaler(ADC_PRESCALE); // set default prescaler |
a2dSetReference(ADC_REFERENCE); // set default reference |
cbi(ADMUX, ADLAR); // set to right-adjusted result |
sbi(ADCSR, ADIE); // enable ADC interrupts |
a2dCompleteFlag = FALSE; // clear conversion complete flag |
sei(); // turn on interrupts (if not already on) |
} |
// turn off a2d converter |
void a2dOff(void) |
{ |
cbi(ADCSR, ADIE); // disable ADC interrupts |
cbi(ADCSR, ADEN); // disable ADC (turn off ADC power) |
} |
// configure A2D converter clock division (prescaling) |
void a2dSetPrescaler(unsigned char prescale) |
{ |
outb(ADCSR, ((inb(ADCSR) & ~ADC_PRESCALE_MASK) | prescale)); |
} |
// configure A2D converter voltage reference |
void a2dSetReference(unsigned char ref) |
{ |
outb(ADMUX, ((inb(ADMUX) & ~ADC_REFERENCE_MASK) | (ref<<6))); |
} |
// sets the a2d input channel |
void a2dSetChannel(unsigned char ch) |
{ |
outb(ADMUX, (inb(ADMUX) & ~ADC_MUX_MASK) | (ch & ADC_MUX_MASK)); // set channel |
} |
// start a conversion on the current a2d input channel |
void a2dStartConvert(void) |
{ |
sbi(ADCSR, ADIF); // clear hardware "conversion complete" flag |
sbi(ADCSR, ADSC); // start conversion |
} |
// return TRUE if conversion is complete |
u08 a2dIsComplete(void) |
{ |
return bit_is_set(ADCSR, ADSC); |
} |
// Perform a 10-bit conversion |
// starts conversion, waits until conversion is done, and returns result |
unsigned short a2dConvert10bit(unsigned char ch) |
{ |
a2dCompleteFlag = FALSE; // clear conversion complete flag |
outb(ADMUX, (inb(ADMUX) & ~ADC_MUX_MASK) | (ch & ADC_MUX_MASK)); // set channel |
sbi(ADCSR, ADIF); // clear hardware "conversion complete" flag |
sbi(ADCSR, ADSC); // start conversion |
//while(!a2dCompleteFlag); // wait until conversion complete |
//while( bit_is_clear(ADCSR, ADIF) ); // wait until conversion complete |
while( bit_is_set(ADCSR, ADSC) ); // wait until conversion complete |
// CAUTION: MUST READ ADCL BEFORE ADCH!!! |
return (inb(ADCL) | (inb(ADCH)<<8)); // read ADC (full 10 bits); |
} |
// Perform a 8-bit conversion. |
// starts conversion, waits until conversion is done, and returns result |
unsigned char a2dConvert8bit(unsigned char ch) |
{ |
// do 10-bit conversion and return highest 8 bits |
return a2dConvert10bit(ch)>>2; // return ADC MSB byte |
} |
//! Interrupt handler for ADC complete interrupt. |
SIGNAL(SIG_ADC) |
{ |
// set the a2d conversion flag to indicate "complete" |
a2dCompleteFlag = TRUE; |
} |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/a2d.h |
---|
0,0 → 1,151 |
/*! \file a2d.h \brief Analog-to-Digital converter function library. */ |
//***************************************************************************** |
// |
// File Name : 'a2d.h' |
// Title : Analog-to-digital converter functions |
// Author : Pascal Stang - Copyright (C) 2002 |
// Created : 4/08/2002 |
// Revised : 4/30/2002 |
// Version : 1.1 |
// Target MCU : Atmel AVR series |
// Editor Tabs : 4 |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
/// \ingroup driver_avr |
/// \defgroup a2d A/D Converter Function Library (a2d.c) |
/// \code #include "a2d.h" \endcode |
/// \par Overview |
/// This library provides an easy interface to the analog-to-digital |
/// converter available on many AVR processors. Updated to support |
/// the ATmega128. |
// |
//**************************************************************************** |
//@{ |
#ifndef A2D_H |
#define A2D_H |
// defines |
// A2D clock prescaler select |
// *selects how much the CPU clock frequency is divided |
// to create the A2D clock frequency |
// *lower division ratios make conversion go faster |
// *higher division ratios make conversions more accurate |
#define ADC_PRESCALE_DIV2 0x00 ///< 0x01,0x00 -> CPU clk/2 |
#define ADC_PRESCALE_DIV4 0x02 ///< 0x02 -> CPU clk/4 |
#define ADC_PRESCALE_DIV8 0x03 ///< 0x03 -> CPU clk/8 |
#define ADC_PRESCALE_DIV16 0x04 ///< 0x04 -> CPU clk/16 |
#define ADC_PRESCALE_DIV32 0x05 ///< 0x05 -> CPU clk/32 |
#define ADC_PRESCALE_DIV64 0x06 ///< 0x06 -> CPU clk/64 |
#define ADC_PRESCALE_DIV128 0x07 ///< 0x07 -> CPU clk/128 |
// default value |
#define ADC_PRESCALE ADC_PRESCALE_DIV64 |
// do not change the mask value |
#define ADC_PRESCALE_MASK 0x07 |
// A2D voltage reference select |
// *this determines what is used as the |
// full-scale voltage point for A2D conversions |
#define ADC_REFERENCE_AREF 0x00 ///< 0x00 -> AREF pin, internal VREF turned off |
#define ADC_REFERENCE_AVCC 0x01 ///< 0x01 -> AVCC pin, internal VREF turned off |
#define ADC_REFERENCE_RSVD 0x02 ///< 0x02 -> Reserved |
#define ADC_REFERENCE_256V 0x03 ///< 0x03 -> Internal 2.56V VREF |
// default value |
#define ADC_REFERENCE ADC_REFERENCE_AVCC |
// do not change the mask value |
#define ADC_REFERENCE_MASK 0xC0 |
// bit mask for A2D channel multiplexer |
#define ADC_MUX_MASK 0x1F |
// channel defines (for reference and use in code) |
// these channels supported by all AVRs with A2D |
#define ADC_CH_ADC0 0x00 |
#define ADC_CH_ADC1 0x01 |
#define ADC_CH_ADC2 0x02 |
#define ADC_CH_ADC3 0x03 |
#define ADC_CH_ADC4 0x04 |
#define ADC_CH_ADC5 0x05 |
#define ADC_CH_ADC6 0x06 |
#define ADC_CH_ADC7 0x07 |
#define ADC_CH_122V 0x1E ///< 1.22V voltage reference |
#define ADC_CH_AGND 0x1F ///< AGND |
// these channels supported only in ATmega128 |
// differential with gain |
#define ADC_CH_0_0_DIFF10X 0x08 |
#define ADC_CH_1_0_DIFF10X 0x09 |
#define ADC_CH_0_0_DIFF200X 0x0A |
#define ADC_CH_1_0_DIFF200X 0x0B |
#define ADC_CH_2_2_DIFF10X 0x0C |
#define ADC_CH_3_2_DIFF10X 0x0D |
#define ADC_CH_2_2_DIFF200X 0x0E |
#define ADC_CH_3_2_DIFF200X 0x0F |
// differential |
#define ADC_CH_0_1_DIFF1X 0x10 |
#define ADC_CH_1_1_DIFF1X 0x11 |
#define ADC_CH_2_1_DIFF1X 0x12 |
#define ADC_CH_3_1_DIFF1X 0x13 |
#define ADC_CH_4_1_DIFF1X 0x14 |
#define ADC_CH_5_1_DIFF1X 0x15 |
#define ADC_CH_6_1_DIFF1X 0x16 |
#define ADC_CH_7_1_DIFF1X 0x17 |
#define ADC_CH_0_2_DIFF1X 0x18 |
#define ADC_CH_1_2_DIFF1X 0x19 |
#define ADC_CH_2_2_DIFF1X 0x1A |
#define ADC_CH_3_2_DIFF1X 0x1B |
#define ADC_CH_4_2_DIFF1X 0x1C |
#define ADC_CH_5_2_DIFF1X 0x1D |
// compatibility for new Mega processors |
// ADCSR hack apparently no longer necessary in new AVR-GCC |
#ifdef ADCSRA |
#ifndef ADCSR |
#define ADCSR ADCSRA |
#endif |
#endif |
#ifdef ADATE |
#define ADFR ADATE |
#endif |
// function prototypes |
//! Initializes the A/D converter. |
/// Turns ADC on and prepares it for use. |
void a2dInit(void); |
//! Turn off A/D converter |
void a2dOff(void); |
//! Sets the division ratio of the A/D converter clock. |
/// This function is automatically called from a2dInit() |
/// with a default value. |
void a2dSetPrescaler(unsigned char prescale); |
//! Configures which voltage reference the A/D converter uses. |
/// This function is automatically called from a2dInit() |
/// with a default value. |
void a2dSetReference(unsigned char ref); |
//! sets the a2d input channel |
void a2dSetChannel(unsigned char ch); |
//! start a conversion on the current a2d input channel |
void a2dStartConvert(void); |
//! return TRUE if conversion is complete |
u08 a2dIsComplete(void); |
//! Starts a conversion on A/D channel# ch, |
/// returns the 10-bit value of the conversion when it is finished. |
unsigned short a2dConvert10bit(unsigned char ch); |
//! Starts a conversion on A/D channel# ch, |
/// returns the 8-bit value of the conversion when it is finished. |
unsigned char a2dConvert8bit(unsigned char ch); |
#endif |
//@} |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/avrlibdefs.h |
---|
0,0 → 1,83 |
/*! \file avrlibdefs.h \brief AVRlib global defines and macros. */ |
//***************************************************************************** |
// |
// File Name : 'avrlibdefs.h' |
// Title : AVRlib global defines and macros include file |
// Author : Pascal Stang |
// Created : 7/12/2001 |
// Revised : 9/30/2002 |
// Version : 1.1 |
// Target MCU : Atmel AVR series |
// Editor Tabs : 4 |
// |
// Description : This include file is designed to contain items useful to all |
// code files and projects, regardless of specific implementation. |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
#ifndef AVRLIBDEFS_H |
#define AVRLIBDEFS_H |
// Code compatibility to new AVR-libc |
// outb(), inb(), inw(), outw(), BV(), sbi(), cbi(), sei(), cli() |
#ifndef outb |
#define outb(addr, data) addr = (data) |
#endif |
#ifndef inb |
#define inb(addr) (addr) |
#endif |
#ifndef outw |
#define outw(addr, data) addr = (data) |
#endif |
#ifndef inw |
#define inw(addr) (addr) |
#endif |
#ifndef BV |
#define BV(bit) (1<<(bit)) |
#endif |
#ifndef cbi |
#define cbi(reg,bit) reg &= ~(BV(bit)) |
#endif |
#ifndef sbi |
#define sbi(reg,bit) reg |= (BV(bit)) |
#endif |
#ifndef cli |
#define cli() __asm__ __volatile__ ("cli" ::) |
#endif |
#ifndef sei |
#define sei() __asm__ __volatile__ ("sei" ::) |
#endif |
// support for individual port pin naming in the mega128 |
// see port128.h for details |
#ifdef __AVR_ATmega128__ |
// not currently necessary due to inclusion |
// of these defines in newest AVR-GCC |
// do a quick test to see if include is needed |
#ifndef PD0 |
#include "port128.h" |
#endif |
#endif |
// use this for packed structures |
// (this is seldom necessary on an 8-bit architecture like AVR, |
// but can assist in code portability to AVR) |
#define GNUC_PACKED __attribute__((packed)) |
// port address helpers |
#define DDR(x) ((x)-1) // address of data direction register of port x |
#define PIN(x) ((x)-2) // address of input register of port x |
// MIN/MAX/ABS macros |
#define MIN(a,b) ((a<b)?(a):(b)) |
#define MAX(a,b) ((a>b)?(a):(b)) |
#define ABS(x) ((x>0)?(x):(-x)) |
// constants |
#define PI 3.14159265359 |
#endif |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/avrlibtypes.h |
---|
0,0 → 1,84 |
/*! \file avrlibtypes.h \brief AVRlib global types and typedefines. */ |
//***************************************************************************** |
// |
// File Name : 'avrlibtypes.h' |
// Title : AVRlib global types and typedefines include file |
// Author : Pascal Stang |
// Created : 7/12/2001 |
// Revised : 9/30/2002 |
// Version : 1.0 |
// Target MCU : Atmel AVR series |
// Editor Tabs : 4 |
// |
// Description : Type-defines required and used by AVRlib. Most types are also |
// generally useful. |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
#ifndef AVRLIBTYPES_H |
#define AVRLIBTYPES_H |
#ifndef WIN32 |
// true/false defines |
#define FALSE 0 |
#define TRUE -1 |
#endif |
// datatype definitions macros |
typedef unsigned char u08; |
typedef signed char s08; |
typedef unsigned short u16; |
typedef signed short s16; |
typedef unsigned long u32; |
typedef signed long s32; |
typedef unsigned long long u64; |
typedef signed long long s64; |
/* use inttypes.h instead |
// C99 standard integer type definitions |
typedef unsigned char uint8_t; |
typedef signed char int8_t; |
typedef unsigned short uint16_t; |
typedef signed short int16_t; |
typedef unsigned long uint32_t; |
typedef signed long int32_t; |
typedef unsigned long uint64_t; |
typedef signed long int64_t; |
*/ |
// maximum value that can be held |
// by unsigned data types (8,16,32bits) |
#define MAX_U08 255 |
#define MAX_U16 65535 |
#define MAX_U32 4294967295 |
// maximum values that can be held |
// by signed data types (8,16,32bits) |
#define MIN_S08 -128 |
#define MAX_S08 127 |
#define MIN_S16 -32768 |
#define MAX_S16 32767 |
#define MIN_S32 -2147483648 |
#define MAX_S32 2147483647 |
#ifndef WIN32 |
// more type redefinitions |
typedef unsigned char BOOL; |
typedef unsigned char BYTE; |
typedef unsigned int WORD; |
typedef unsigned long DWORD; |
typedef unsigned char UCHAR; |
typedef unsigned int UINT; |
typedef unsigned short USHORT; |
typedef unsigned long ULONG; |
typedef char CHAR; |
typedef int INT; |
typedef long LONG; |
#endif |
#endif |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/buffer.c |
---|
0,0 → 1,149 |
/*! \file buffer.c \brief Multipurpose byte buffer structure and methods. */ |
//***************************************************************************** |
// |
// File Name : 'buffer.c' |
// Title : Multipurpose byte buffer structure and methods |
// Author : Pascal Stang - Copyright (C) 2001-2002 |
// Created : 9/23/2001 |
// Revised : 9/23/2001 |
// Version : 1.0 |
// Target MCU : any |
// Editor Tabs : 4 |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
#include "buffer.h" |
#include "global.h" |
#include "avr/io.h" |
#ifndef CRITICAL_SECTION_START |
#define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli() |
#define CRITICAL_SECTION_END SREG = _sreg |
#endif |
// global variables |
// initialization |
void bufferInit(cBuffer* buffer, unsigned char *start, unsigned short size) |
{ |
// begin critical section |
CRITICAL_SECTION_START; |
// set start pointer of the buffer |
buffer->dataptr = start; |
buffer->size = size; |
// initialize index and length |
buffer->dataindex = 0; |
buffer->datalength = 0; |
// end critical section |
CRITICAL_SECTION_END; |
} |
// access routines |
unsigned char bufferGetFromFront(cBuffer* buffer) |
{ |
unsigned char data = 0; |
// begin critical section |
CRITICAL_SECTION_START; |
// check to see if there's data in the buffer |
if(buffer->datalength) |
{ |
// get the first character from buffer |
data = buffer->dataptr[buffer->dataindex]; |
// move index down and decrement length |
buffer->dataindex++; |
if(buffer->dataindex >= buffer->size) |
{ |
buffer->dataindex -= buffer->size; |
} |
buffer->datalength--; |
} |
// end critical section |
CRITICAL_SECTION_END; |
// return |
return data; |
} |
void bufferDumpFromFront(cBuffer* buffer, unsigned short numbytes) |
{ |
// begin critical section |
CRITICAL_SECTION_START; |
// dump numbytes from the front of the buffer |
// are we dumping less than the entire buffer? |
if(numbytes < buffer->datalength) |
{ |
// move index down by numbytes and decrement length by numbytes |
buffer->dataindex += numbytes; |
if(buffer->dataindex >= buffer->size) |
{ |
buffer->dataindex -= buffer->size; |
} |
buffer->datalength -= numbytes; |
} |
else |
{ |
// flush the whole buffer |
buffer->datalength = 0; |
} |
// end critical section |
CRITICAL_SECTION_END; |
} |
unsigned char bufferGetAtIndex(cBuffer* buffer, unsigned short index) |
{ |
// begin critical section |
CRITICAL_SECTION_START; |
// return character at index in buffer |
unsigned char data = buffer->dataptr[(buffer->dataindex+index)%(buffer->size)]; |
// end critical section |
CRITICAL_SECTION_END; |
return data; |
} |
unsigned char bufferAddToEnd(cBuffer* buffer, unsigned char data) |
{ |
// begin critical section |
CRITICAL_SECTION_START; |
// make sure the buffer has room |
if(buffer->datalength < buffer->size) |
{ |
// save data byte at end of buffer |
buffer->dataptr[(buffer->dataindex + buffer->datalength) % buffer->size] = data; |
// increment the length |
buffer->datalength++; |
// end critical section |
CRITICAL_SECTION_END; |
// return success |
return -1; |
} |
// end critical section |
CRITICAL_SECTION_END; |
// return failure |
return 0; |
} |
unsigned short bufferIsNotFull(cBuffer* buffer) |
{ |
// begin critical section |
CRITICAL_SECTION_START; |
// check to see if the buffer has room |
// return true if there is room |
unsigned short bytesleft = (buffer->size - buffer->datalength); |
// end critical section |
CRITICAL_SECTION_END; |
return bytesleft; |
} |
void bufferFlush(cBuffer* buffer) |
{ |
// begin critical section |
CRITICAL_SECTION_START; |
// flush contents of the buffer |
buffer->datalength = 0; |
// end critical section |
CRITICAL_SECTION_END; |
} |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/buffer.h |
---|
0,0 → 1,74 |
/*! \file buffer.h \brief Multipurpose byte buffer structure and methods. */ |
//***************************************************************************** |
// |
// File Name : 'buffer.h' |
// Title : Multipurpose byte buffer structure and methods |
// Author : Pascal Stang - Copyright (C) 2001-2002 |
// Created : 9/23/2001 |
// Revised : 11/16/2002 |
// Version : 1.1 |
// Target MCU : any |
// Editor Tabs : 4 |
// |
/// \ingroup general |
/// \defgroup buffer Circular Byte-Buffer Structure and Function Library (buffer.c) |
/// \code #include "buffer.h" \endcode |
/// \par Overview |
/// This byte-buffer structure provides an easy and efficient way to store |
/// and process a stream of bytes.� You can create as many buffers as you |
/// like (within memory limits), and then use this common set of functions to |
/// access each buffer.� The buffers are designed for FIFO�operation (first |
/// in, first out).� This means that the first byte you put in the buffer |
/// will be the first one you get when you read out the buffer.� Supported |
/// functions include buffer initialize, get byte from front of buffer, add |
/// byte to end of buffer, check if buffer is full, and flush buffer.� The |
/// buffer uses a circular design so no copying of data is ever necessary. |
/// This buffer is not dynamically allocated, it has a user-defined fixed |
/// maximum size.� This buffer is used in many places in the avrlib code. |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
//@{ |
#ifndef BUFFER_H |
#define BUFFER_H |
// structure/typdefs |
//! cBuffer structure |
typedef struct struct_cBuffer |
{ |
unsigned char *dataptr; ///< the physical memory address where the buffer is stored |
unsigned short size; ///< the allocated size of the buffer |
unsigned short datalength; ///< the length of the data currently in the buffer |
unsigned short dataindex; ///< the index into the buffer where the data starts |
} cBuffer; |
// function prototypes |
//! initialize a buffer to start at a given address and have given size |
void bufferInit(cBuffer* buffer, unsigned char *start, unsigned short size); |
//! get the first byte from the front of the buffer |
unsigned char bufferGetFromFront(cBuffer* buffer); |
//! dump (discard) the first numbytes from the front of the buffer |
void bufferDumpFromFront(cBuffer* buffer, unsigned short numbytes); |
//! get a byte at the specified index in the buffer (kind of like array access) |
// ** note: this does not remove the byte that was read from the buffer |
unsigned char bufferGetAtIndex(cBuffer* buffer, unsigned short index); |
//! add a byte to the end of the buffer |
unsigned char bufferAddToEnd(cBuffer* buffer, unsigned char data); |
//! check if the buffer is full/not full (returns zero value if full) |
unsigned short bufferIsNotFull(cBuffer* buffer); |
//! flush (clear) the contents of the buffer |
void bufferFlush(cBuffer* buffer); |
#endif |
//@} |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/global.h |
---|
0,0 → 1,42 |
//***************************************************************************** |
// |
// File Name : 'global.h' |
// Title : AVR project global include |
// Author : Pascal Stang |
// Created : 7/12/2001 |
// Revised : 9/30/2002 |
// Version : 1.1 |
// Target MCU : Atmel AVR series |
// Editor Tabs : 4 |
// |
// Description : This include file is designed to contain items useful to all |
// code files and projects. |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
#ifndef GLOBAL_H |
#define GLOBAL_H |
// global AVRLIB defines |
#include "avrlibdefs.h" |
// global AVRLIB types definitions |
#include "avrlibtypes.h" |
// project/system dependent defines |
#define UART_RX_BUFFER_SIZE 0x00FF |
// CPU clock speed |
//#define F_CPU 16000000 // 16MHz processor |
//#define F_CPU 14745000 // 14.745MHz processor |
#define F_CPU 8000000 // 8MHz processor |
//#define F_CPU 7372800 // 7.37MHz processor |
//#define F_CPU 4000000 // 4MHz processor |
//#define F_CPU 3686400 // 3.69MHz processor |
#define CYCLES_PER_US ((F_CPU+500000)/1000000) // cpu cycles per microsecond |
#endif |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/rprintf.c |
---|
0,0 → 1,782 |
/*! \file rprintf.c \brief printf routine and associated routines. */ |
//***************************************************************************** |
// |
// File Name : 'rprintf.c' |
// Title : printf routine and associated routines |
// Author : Pascal Stang - Copyright (C) 2000-2002 |
// Created : 2000.12.26 |
// Revised : 2003.5.1 |
// Version : 1.0 |
// Target MCU : Atmel AVR series and other targets |
// Editor Tabs : 4 |
// |
// NOTE: This code is currently below version 1.0, and therefore is considered |
// to be lacking in some functionality or documentation, or may not be fully |
// tested. Nonetheless, you can expect most functions to work. |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
#include <avr/pgmspace.h> |
//#include <string-avr.h> |
//#include <stdlib.h> |
#include <stdarg.h> |
#include "global.h" |
#include "rprintf.h" |
#ifndef TRUE |
#define TRUE -1 |
#define FALSE 0 |
#endif |
#define INF 32766 // maximum field size to print |
#define READMEMBYTE(a,char_ptr) ((a)?(pgm_read_byte(char_ptr)):(*char_ptr)) |
#ifdef RPRINTF_COMPLEX |
static unsigned char buf[128]; |
#endif |
// use this to store hex conversion in RAM |
//static char HexChars[] = "0123456789ABCDEF"; |
// use this to store hex conversion in program memory |
//static prog_char HexChars[] = "0123456789ABCDEF"; |
static char __attribute__ ((progmem)) HexChars[] = "0123456789ABCDEF"; |
#define hexchar(x) pgm_read_byte( HexChars+((x)&0x0f) ) |
//#define hexchar(x) ((((x)&0x0F)>9)?((x)+'A'-10):((x)+'0')) |
// function pointer to single character output routine |
static void (*rputchar)(unsigned char c); |
// *** rprintf initialization *** |
// you must call this function once and supply the character output |
// routine before using other functions in this library |
void rprintfInit(void (*putchar_func)(unsigned char c)) |
{ |
rputchar = putchar_func; |
} |
// *** rprintfChar *** |
// send a character/byte to the current output device |
void rprintfChar(unsigned char c) |
{ |
// do LF -> CR/LF translation |
if(c == '\n') |
rputchar('\r'); |
// send character |
rputchar(c); |
} |
// *** rprintfStr *** |
// prints a null-terminated string stored in RAM |
void rprintfStr(char str[]) |
{ |
// send a string stored in RAM |
// check to make sure we have a good pointer |
if (!str) return; |
// print the string until a null-terminator |
while (*str) |
rprintfChar(*str++); |
} |
// *** rprintfStrLen *** |
// prints a section of a string stored in RAM |
// begins printing at position indicated by <start> |
// prints number of characters indicated by <len> |
void rprintfStrLen(char str[], unsigned int start, unsigned int len) |
{ |
register int i=0; |
// check to make sure we have a good pointer |
if (!str) return; |
// spin through characters up to requested start |
// keep going as long as there's no null |
while((i++<start) && (*str++)); |
// for(i=0; i<start; i++) |
// { |
// // keep steping through string as long as there's no null |
// if(*str) str++; |
// } |
// then print exactly len characters |
for(i=0; i<len; i++) |
{ |
// print data out of the string as long as we haven't reached a null yet |
// at the null, start printing spaces |
if(*str) |
rprintfChar(*str++); |
else |
rprintfChar(' '); |
} |
} |
// *** rprintfProgStr *** |
// prints a null-terminated string stored in program ROM |
void rprintfProgStr(const prog_char str[]) |
{ |
// print a string stored in program memory |
register char c; |
// check to make sure we have a good pointer |
if (!str) return; |
// print the string until the null-terminator |
while((c = pgm_read_byte(str++))) |
rprintfChar(c); |
} |
// *** rprintfCRLF *** |
// prints carriage return and line feed |
void rprintfCRLF(void) |
{ |
// print CR/LF |
//rprintfChar('\r'); |
// LF -> CR/LF translation built-in to rprintfChar() |
rprintfChar('\n'); |
} |
// *** rprintfu04 *** |
// prints an unsigned 4-bit number in hex (1 digit) |
void rprintfu04(unsigned char data) |
{ |
// print 4-bit hex value |
// char Character = data&0x0f; |
// if (Character>9) |
// Character+='A'-10; |
// else |
// Character+='0'; |
rprintfChar(hexchar(data)); |
} |
// *** rprintfu08 *** |
// prints an unsigned 8-bit number in hex (2 digits) |
void rprintfu08(unsigned char data) |
{ |
// print 8-bit hex value |
rprintfu04(data>>4); |
rprintfu04(data); |
} |
// *** rprintfu16 *** |
// prints an unsigned 16-bit number in hex (4 digits) |
void rprintfu16(unsigned short data) |
{ |
// print 16-bit hex value |
rprintfu08(data>>8); |
rprintfu08(data); |
} |
// *** rprintfu32 *** |
// prints an unsigned 32-bit number in hex (8 digits) |
void rprintfu32(unsigned long data) |
{ |
// print 32-bit hex value |
rprintfu16(data>>16); |
rprintfu16(data); |
} |
// *** rprintfNum *** |
// special printf for numbers only |
// see formatting information below |
// Print the number "n" in the given "base" |
// using exactly "numDigits" |
// print +/- if signed flag "isSigned" is TRUE |
// use the character specified in "padchar" to pad extra characters |
// |
// Examples: |
// uartPrintfNum(10, 6, TRUE, ' ', 1234); --> " +1234" |
// uartPrintfNum(10, 6, FALSE, '0', 1234); --> "001234" |
// uartPrintfNum(16, 6, FALSE, '.', 0x5AA5); --> "..5AA5" |
void rprintfNum(char base, char numDigits, char isSigned, char padchar, long n) |
{ |
// define a global HexChars or use line below |
//static char HexChars[16] = "0123456789ABCDEF"; |
char *p, buf[32]; |
unsigned long x; |
unsigned char count; |
// prepare negative number |
if( isSigned && (n < 0) ) |
{ |
x = -n; |
} |
else |
{ |
x = n; |
} |
// setup little string buffer |
count = (numDigits-1)-(isSigned?1:0); |
p = buf + sizeof (buf); |
*--p = '\0'; |
// force calculation of first digit |
// (to prevent zero from not printing at all!!!) |
*--p = hexchar(x%base); x /= base; |
// calculate remaining digits |
while(count--) |
{ |
if(x != 0) |
{ |
// calculate next digit |
*--p = hexchar(x%base); x /= base; |
} |
else |
{ |
// no more digits left, pad out to desired length |
*--p = padchar; |
} |
} |
// apply signed notation if requested |
if( isSigned ) |
{ |
if(n < 0) |
{ |
*--p = '-'; |
} |
else if(n > 0) |
{ |
*--p = '+'; |
} |
else |
{ |
*--p = ' '; |
} |
} |
// print the string right-justified |
count = numDigits; |
while(count--) |
{ |
rprintfChar(*p++); |
} |
} |
#ifdef RPRINTF_FLOAT |
// *** rprintfFloat *** |
// floating-point print |
void rprintfFloat(char numDigits, double x) |
{ |
unsigned char firstplace = FALSE; |
unsigned char negative; |
unsigned char i, digit; |
double place = 1.0; |
// save sign |
negative = (x<0); |
// convert to absolute value |
x = (x>0)?(x):(-x); |
// find starting digit place |
for(i=0; i<15; i++) |
{ |
if((x/place) < 10.0) |
break; |
else |
place *= 10.0; |
} |
// print polarity character |
if(negative) |
rprintfChar('-'); |
else |
rprintfChar('+'); |
// print digits |
for(i=0; i<numDigits; i++) |
{ |
digit = (x/place); |
if(digit | firstplace | (place == 1.0)) |
{ |
firstplace = TRUE; |
rprintfChar(digit+0x30); |
} |
else |
rprintfChar(' '); |
if(place == 1.0) |
{ |
rprintfChar('.'); |
} |
x -= (digit*place); |
place /= 10.0; |
} |
} |
#endif |
#ifdef RPRINTF_SIMPLE |
// *** rprintf1RamRom *** |
// called by rprintf() - does a simple printf (supports %d, %x, %c) |
// Supports: |
// %d - decimal |
// %x - hex |
// %c - character |
int rprintf1RamRom(unsigned char stringInRom, const char *format, ...) |
{ |
// simple printf routine |
// define a global HexChars or use line below |
//static char HexChars[16] = "0123456789ABCDEF"; |
char format_flag; |
unsigned int u_val, div_val, base; |
va_list ap; |
va_start(ap, format); |
for (;;) |
{ |
while ((format_flag = READMEMBYTE(stringInRom,format++) ) != '%') |
{ // Until '%' or '\0' |
if (!format_flag) |
{ |
va_end(ap); |
return(0); |
} |
rprintfChar(format_flag); |
} |
switch (format_flag = READMEMBYTE(stringInRom,format++) ) |
{ |
case 'c': format_flag = va_arg(ap,int); |
default: rprintfChar(format_flag); continue; |
case 'd': base = 10; div_val = 10000; goto CONVERSION_LOOP; |
// case 'x': base = 16; div_val = 0x10; |
case 'x': base = 16; div_val = 0x1000; |
CONVERSION_LOOP: |
u_val = va_arg(ap,int); |
if (format_flag == 'd') |
{ |
if (((int)u_val) < 0) |
{ |
u_val = - u_val; |
rprintfChar('-'); |
} |
while (div_val > 1 && div_val > u_val) div_val /= 10; |
} |
do |
{ |
//rprintfChar(pgm_read_byte(HexChars+(u_val/div_val))); |
rprintfu04(u_val/div_val); |
u_val %= div_val; |
div_val /= base; |
} while (div_val); |
} |
} |
va_end(ap); |
} |
#endif |
#ifdef RPRINTF_COMPLEX |
// *** rprintf2RamRom *** |
// called by rprintf() - does a more powerful printf (supports %d, %u, %o, %x, %c, %s) |
// Supports: |
// %d - decimal |
// %u - unsigned decimal |
// %o - octal |
// %x - hex |
// %c - character |
// %s - strings |
// and the width,precision,padding modifiers |
// **this printf does not support floating point numbers |
int rprintf2RamRom(unsigned char stringInRom, const char *sfmt, ...) |
{ |
register unsigned char *f, *bp; |
register long l; |
register unsigned long u; |
register int i; |
register int fmt; |
register unsigned char pad = ' '; |
int flush_left = 0, f_width = 0, prec = INF, hash = 0, do_long = 0; |
int sign = 0; |
va_list ap; |
va_start(ap, sfmt); |
f = (unsigned char *) sfmt; |
for (; READMEMBYTE(stringInRom,f); f++) |
{ |
if (READMEMBYTE(stringInRom,f) != '%') |
{ // not a format character |
// then just output the char |
rprintfChar(READMEMBYTE(stringInRom,f)); |
} |
else |
{ |
f++; // if we have a "%" then skip it |
if (READMEMBYTE(stringInRom,f) == '-') |
{ |
flush_left = 1; // minus: flush left |
f++; |
} |
if (READMEMBYTE(stringInRom,f) == '0' |
|| READMEMBYTE(stringInRom,f) == '.') |
{ |
// padding with 0 rather than blank |
pad = '0'; |
f++; |
} |
if (READMEMBYTE(stringInRom,f) == '*') |
{ // field width |
f_width = va_arg(ap, int); |
f++; |
} |
else if (Isdigit(READMEMBYTE(stringInRom,f))) |
{ |
f_width = atoiRamRom(stringInRom, (char *) f); |
while (Isdigit(READMEMBYTE(stringInRom,f))) |
f++; // skip the digits |
} |
if (READMEMBYTE(stringInRom,f) == '.') |
{ // precision |
f++; |
if (READMEMBYTE(stringInRom,f) == '*') |
{ |
prec = va_arg(ap, int); |
f++; |
} |
else if (Isdigit(READMEMBYTE(stringInRom,f))) |
{ |
prec = atoiRamRom(stringInRom, (char *) f); |
while (Isdigit(READMEMBYTE(stringInRom,f))) |
f++; // skip the digits |
} |
} |
if (READMEMBYTE(stringInRom,f) == '#') |
{ // alternate form |
hash = 1; |
f++; |
} |
if (READMEMBYTE(stringInRom,f) == 'l') |
{ // long format |
do_long = 1; |
f++; |
} |
fmt = READMEMBYTE(stringInRom,f); |
bp = buf; |
switch (fmt) { // do the formatting |
case 'd': // 'd' signed decimal |
if (do_long) |
l = va_arg(ap, long); |
else |
l = (long) (va_arg(ap, int)); |
if (l < 0) |
{ |
sign = 1; |
l = -l; |
} |
do { |
*bp++ = l % 10 + '0'; |
} while ((l /= 10) > 0); |
if (sign) |
*bp++ = '-'; |
f_width = f_width - (bp - buf); |
if (!flush_left) |
while (f_width-- > 0) |
rprintfChar(pad); |
for (bp--; bp >= buf; bp--) |
rprintfChar(*bp); |
if (flush_left) |
while (f_width-- > 0) |
rprintfChar(' '); |
break; |
case 'o': // 'o' octal number |
case 'x': // 'x' hex number |
case 'u': // 'u' unsigned decimal |
if (do_long) |
u = va_arg(ap, unsigned long); |
else |
u = (unsigned long) (va_arg(ap, unsigned)); |
if (fmt == 'u') |
{ // unsigned decimal |
do { |
*bp++ = u % 10 + '0'; |
} while ((u /= 10) > 0); |
} |
else if (fmt == 'o') |
{ // octal |
do { |
*bp++ = u % 8 + '0'; |
} while ((u /= 8) > 0); |
if (hash) |
*bp++ = '0'; |
} |
else if (fmt == 'x') |
{ // hex |
do { |
i = u % 16; |
if (i < 10) |
*bp++ = i + '0'; |
else |
*bp++ = i - 10 + 'a'; |
} while ((u /= 16) > 0); |
if (hash) |
{ |
*bp++ = 'x'; |
*bp++ = '0'; |
} |
} |
i = f_width - (bp - buf); |
if (!flush_left) |
while (i-- > 0) |
rprintfChar(pad); |
for (bp--; bp >= buf; bp--) |
rprintfChar((int) (*bp)); |
if (flush_left) |
while (i-- > 0) |
rprintfChar(' '); |
break; |
case 'c': // 'c' character |
i = va_arg(ap, int); |
rprintfChar((int) (i)); |
break; |
case 's': // 's' string |
bp = va_arg(ap, unsigned char *); |
if (!bp) |
bp = (unsigned char *) "(nil)"; |
f_width = f_width - strlen((char *) bp); |
if (!flush_left) |
while (f_width-- > 0) |
rprintfChar(pad); |
for (i = 0; *bp && i < prec; i++) |
{ |
rprintfChar(*bp); |
bp++; |
} |
if (flush_left) |
while (f_width-- > 0) |
rprintfChar(' '); |
break; |
case '%': // '%' character |
rprintfChar('%'); |
break; |
} |
flush_left = 0, f_width = 0, prec = INF, hash = 0, do_long = 0; |
sign = 0; |
pad = ' '; |
} |
} |
va_end(ap); |
return 0; |
} |
unsigned char Isdigit(char c) |
{ |
if((c >= 0x30) && (c <= 0x39)) |
return TRUE; |
else |
return FALSE; |
} |
int atoiRamRom(unsigned char stringInRom, char *str) |
{ |
int num = 0;; |
while(Isdigit(READMEMBYTE(stringInRom,str))) |
{ |
num *= 10; |
num += ((READMEMBYTE(stringInRom,str++)) - 0x30); |
} |
return num; |
} |
#endif |
//****************************************************************************** |
// code below this line is commented out and can be ignored |
//****************************************************************************** |
/* |
char* sprintf(const char *sfmt, ...) |
{ |
register unsigned char *f, *bp, *str; |
register long l; |
register unsigned long u; |
register int i; |
register int fmt; |
register unsigned char pad = ' '; |
int flush_left = 0, f_width = 0, prec = INF, hash = 0, do_long = 0; |
int sign = 0; |
va_list ap; |
va_start(ap, sfmt); |
str = bufstring; |
f = (unsigned char *) sfmt; |
for (; *f; f++) |
{ |
if (*f != '%') |
{ // not a format character |
*str++ = (*f); // then just output the char |
} |
else |
{ |
f++; // if we have a "%" then skip it |
if (*f == '-') |
{ |
flush_left = 1; // minus: flush left |
f++; |
} |
if (*f == '0' || *f == '.') |
{ |
// padding with 0 rather than blank |
pad = '0'; |
f++; |
} |
if (*f == '*') |
{ // field width |
f_width = va_arg(ap, int); |
f++; |
} |
else if (Isdigit(*f)) |
{ |
f_width = atoi((char *) f); |
while (Isdigit(*f)) |
f++; // skip the digits |
} |
if (*f == '.') |
{ // precision |
f++; |
if (*f == '*') |
{ |
prec = va_arg(ap, int); |
f++; |
} |
else if (Isdigit(*f)) |
{ |
prec = atoi((char *) f); |
while (Isdigit(*f)) |
f++; // skip the digits |
} |
} |
if (*f == '#') |
{ // alternate form |
hash = 1; |
f++; |
} |
if (*f == 'l') |
{ // long format |
do_long = 1; |
f++; |
} |
fmt = *f; |
bp = buf; |
switch (fmt) { // do the formatting |
case 'd': // 'd' signed decimal |
if (do_long) |
l = va_arg(ap, long); |
else |
l = (long) (va_arg(ap, int)); |
if (l < 0) |
{ |
sign = 1; |
l = -l; |
} |
do { |
*bp++ = l % 10 + '0'; |
} while ((l /= 10) > 0); |
if (sign) |
*bp++ = '-'; |
f_width = f_width - (bp - buf); |
if (!flush_left) |
while (f_width-- > 0) |
*str++ = (pad); |
for (bp--; bp >= buf; bp--) |
*str++ = (*bp); |
if (flush_left) |
while (f_width-- > 0) |
*str++ = (' '); |
break; |
case 'o': // 'o' octal number |
case 'x': // 'x' hex number |
case 'u': // 'u' unsigned decimal |
if (do_long) |
u = va_arg(ap, unsigned long); |
else |
u = (unsigned long) (va_arg(ap, unsigned)); |
if (fmt == 'u') |
{ // unsigned decimal |
do { |
*bp++ = u % 10 + '0'; |
} while ((u /= 10) > 0); |
} |
else if (fmt == 'o') |
{ // octal |
do { |
*bp++ = u % 8 + '0'; |
} while ((u /= 8) > 0); |
if (hash) |
*bp++ = '0'; |
} |
else if (fmt == 'x') |
{ // hex |
do { |
i = u % 16; |
if (i < 10) |
*bp++ = i + '0'; |
else |
*bp++ = i - 10 + 'a'; |
} while ((u /= 16) > 0); |
if (hash) |
{ |
*bp++ = 'x'; |
*bp++ = '0'; |
} |
} |
i = f_width - (bp - buf); |
if (!flush_left) |
while (i-- > 0) |
*str++ = (pad); |
for (bp--; bp >= buf; bp--) |
*str++ = ((int) (*bp)); |
if (flush_left) |
while (i-- > 0) |
*str++ = (' '); |
break; |
case 'c': // 'c' character |
i = va_arg(ap, int); |
*str++ = ((int) (i)); |
break; |
case 's': // 's' string |
bp = va_arg(ap, unsigned char *); |
if (!bp) |
bp = (unsigned char *) "(nil)"; |
f_width = f_width - strlen((char *) bp); |
if (!flush_left) |
while (f_width-- > 0) |
*str++ = (pad); |
for (i = 0; *bp && i < prec; i++) |
{ |
*str++ = (*bp); |
bp++; |
} |
if (flush_left) |
while (f_width-- > 0) |
*str++ = (' '); |
break; |
case '%': // '%' character |
*str++ = ('%'); |
break; |
} |
flush_left = 0, f_width = 0, prec = INF, hash = 0, do_long = 0; |
sign = 0; |
pad = ' '; |
} |
} |
va_end(ap); |
// terminate string with null |
*str++ = '\0'; |
return bufstring; |
} |
*/ |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/rprintf.h |
---|
0,0 → 1,191 |
/*! \file rprintf.h \brief printf routine and associated routines. */ |
//**************************************************************************** |
// |
// File Name : 'rprintf.h' |
// Title : printf routine and associated routines |
// Author : Pascal Stang - Copyright (C) 2000-2002 |
// Created : 2000.12.26 |
// Revised : 2003.5.1 |
// Version : 1.0 |
// Target MCU : Atmel AVR series and other targets |
// Editor Tabs : 4 |
// |
// NOTE: This code is currently below version 1.0, and therefore is considered |
// to be lacking in some functionality or documentation, or may not be fully |
// tested. Nonetheless, you can expect most functions to work. |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
/// \ingroup general |
/// \defgroup rprintf printf() Function Library (rprintf.c) |
/// \code #include "rprintf.h" \endcode |
/// \par Overview |
/// The rprintf function library provides a simplified (reduced) version of |
/// the common C printf() function.� See the code files for details about |
/// which printf features are supported.� Also in this library are a |
/// variety of functions for fast printing of certain common data types |
/// (variable types).� Functions include print string from RAM, print |
/// string from ROM, print string snippet, print hex byte/short/long, and |
/// a custom-formatted number print, as well as an optional floating-point |
/// print routine. |
/// |
/// \note All output from the rprintf library can be directed to any device |
/// or software which accepts characters.� This means that rprintf output |
/// can be sent to the UART (serial port) or can be used with the LCD |
/// display libraries to print formatted text on the screen. |
// |
//**************************************************************************** |
//@{ |
#ifndef RPRINTF_H |
#define RPRINTF_H |
// needed for use of PSTR below |
#include <avr/pgmspace.h> |
// configuration |
// defining RPRINTF_SIMPLE will compile a smaller, simpler, and faster printf() function |
// defining RPRINTF_COMPLEX will compile a larger, more capable, and slower printf() function |
#ifndef RPRINTF_COMPLEX |
#define RPRINTF_SIMPLE |
#endif |
// Define RPRINTF_FLOAT to enable the floating-point printf function: rprintfFloat() |
// (adds +4600bytes or 2.2Kwords of code) |
// defines/constants |
#define STRING_IN_RAM 0 |
#define STRING_IN_ROM 1 |
// make a putchar for those that are used to using it |
//#define putchar(c) rprintfChar(c); |
// functions |
//! Initializes the rprintf library for an output stream. |
/// You must call this initializer once before using any other rprintf function. |
/// The argument must be a character stream output function. |
void rprintfInit(void (*putchar_func)(unsigned char c)); |
//! prints a single character to the current output device |
void rprintfChar(unsigned char c); |
//! prints a null-terminated string stored in RAM |
void rprintfStr(char str[]); |
//! Prints a section of a string stored in RAM. |
/// Begins printing at position indicated by <start>, |
/// and prints number of characters indicated by <len>. |
void rprintfStrLen(char str[], unsigned int start, unsigned int len); |
//! prints a string stored in program rom |
/// \note This function does not actually store your string in |
/// program rom, but merely reads it assuming you stored it properly. |
void rprintfProgStr(const prog_char str[]); |
//! Using the function rprintfProgStrM(...) automatically causes |
/// your string to be stored in ROM, thereby not wasting precious RAM. |
/// Example usage: |
/// \code |
/// rprintfProgStrM("Hello, this string is stored in program rom"); |
/// \endcode |
#define rprintfProgStrM(string) (rprintfProgStr(PSTR(string))) |
//! Prints a carriage-return and line-feed. |
/// Useful when printing to serial ports/terminals. |
void rprintfCRLF(void); |
// Prints the number contained in "data" in hex format |
// u04,u08,u16,and u32 functions handle 4,8,16,or 32 bits respectively |
void rprintfu04(unsigned char data); ///< Print 4-bit hex number. Outputs a single hex character. |
void rprintfu08(unsigned char data); ///< Print 8-bit hex number. Outputs two hex characters. |
void rprintfu16(unsigned short data); ///< Print 16-bit hex number. Outputs four hex characters. |
void rprintfu32(unsigned long data); ///< Print 32-bit hex number. Outputs eight hex characters. |
//! A flexible integer-number printing routine. |
/// Print the number "n" in the given "base", using exactly "numDigits". |
/// Print +/- if signed flag "isSigned" is TRUE. |
/// The character specified in "padchar" will be used to pad extra characters. |
/// |
/// Examples: |
/// \code |
/// uartPrintfNum(10, 6, TRUE, ' ', 1234); --> " +1234" |
/// uartPrintfNum(10, 6, FALSE, '0', 1234); --> "001234" |
/// uartPrintfNum(16, 6, FALSE, '.', 0x5AA5); --> "..5AA5" |
/// \endcode |
void rprintfNum(char base, char numDigits, char isSigned, char padchar, long n); |
#ifdef RPRINTF_FLOAT |
//! floating-point print routine |
void rprintfFloat(char numDigits, double x); |
#endif |
// NOTE: Below you'll see the function prototypes of rprintf1RamRom and |
// rprintf2RamRom. rprintf1RamRom and rprintf2RamRom are both reduced versions |
// of the regular C printf() command. However, they are modified to be able |
// to read their text/format strings from RAM or ROM in the Atmel microprocessors. |
// Unless you really intend to, do not use the "RamRom" versions of the functions |
// directly. Instead use the #defined function versions: |
// |
// printfx("text/format",args) ...to keep your text/format string stored in RAM |
// - or - |
// printfxROM("text/format",args) ...to keep your text/format string stored in ROM |
// |
// where x is either 1 or 2 for the simple or more powerful version of printf() |
// |
// Since there is much more ROM than RAM available in the Atmel microprocessors, |
// and nearly all text/format strings are constant (never change in the course |
// of the program), you should try to use the ROM printf version exclusively. |
// This will ensure you leave as much RAM as possible for program variables and |
// data. |
//! \fn int rprintf(const char *format, ...); |
/// A reduced substitute for the usual C printf() function. |
/// This function actually points to either rprintf1RamRom or rprintf2RamRom |
/// depending on the user's selection. Rprintf1 is a simple small fast print |
/// routine while rprintf2 is larger and slower but more capable. To choose |
/// the routine you would like to use, define either RPRINTF_SIMPLE or |
/// RPRINTF_COMPLEX in global.h. |
#ifdef RPRINTF_SIMPLE |
//! A simple printf routine. |
/// Called by rprintf() - does a simple printf (supports %d, %x, %c). |
/// Supports: |
/// - %d - decimal |
/// - %x - hex |
/// - %c - character |
int rprintf1RamRom(unsigned char stringInRom, const char *format, ...); |
// #defines for RAM or ROM operation |
#define rprintf1(format, args...) rprintf1RamRom(STRING_IN_ROM, PSTR(format), ## args) |
#define rprintf1RAM(format, args...) rprintf1RamRom(STRING_IN_RAM, format, ## args) |
// *** Default rprintf(...) *** |
// this next line determines what the the basic rprintf() defaults to: |
#define rprintf(format, args...) rprintf1RamRom(STRING_IN_ROM, PSTR(format), ## args) |
#endif |
#ifdef RPRINTF_COMPLEX |
//! A more powerful printf routine. |
/// Called by rprintf() - does a more powerful printf (supports %d, %u, %o, %x, %c, %s). |
/// Supports: |
/// - %d - decimal |
/// - %u - unsigned decimal |
/// - %o - octal |
/// - %x - hex |
/// - %c - character |
/// - %s - strings |
/// - and the width,precision,padding modifiers |
/// \note This printf does not support floating point numbers. |
int rprintf2RamRom(unsigned char stringInRom, const char *sfmt, ...); |
// #defines for RAM or ROM operation |
#define rprintf2(format, args...) rprintf2RamRom(STRING_IN_ROM, format, ## args) |
#define rprintf2RAM(format, args...) rprintf2RamRom(STRING_IN_RAM, format, ## args) |
// *** Default rprintf(...) *** |
// this next line determines what the the basic rprintf() defaults to: |
#define rprintf(format, args...) rprintf2RamRom(STRING_IN_ROM, PSTR(format), ## args) |
#endif |
#endif |
//@} |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/timer.c |
---|
0,0 → 1,469 |
/*! \file timer.c \brief System Timer function library. */ |
//***************************************************************************** |
// |
// File Name : 'timer.c' |
// Title : System Timer function library |
// Author : Pascal Stang - Copyright (C) 2000-2002 |
// Created : 11/22/2000 |
// Revised : 07/09/2003 |
// Version : 1.1 |
// Target MCU : Atmel AVR Series |
// Editor Tabs : 4 |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
//***************************************************************************** |
#include <avr/io.h> |
#include <avr/interrupt.h> |
#include <avr/pgmspace.h> |
#include <avr/sleep.h> |
#include "global.h" |
#include "timer.h" |
#include "rprintf.h" |
// Program ROM constants |
// the prescale division values stored in order of timer control register index |
// STOP, CLK, CLK/8, CLK/64, CLK/256, CLK/1024 |
unsigned short __attribute__ ((progmem)) TimerPrescaleFactor[] = {0,1,8,64,256,1024}; |
// the prescale division values stored in order of timer control register index |
// STOP, CLK, CLK/8, CLK/32, CLK/64, CLK/128, CLK/256, CLK/1024 |
unsigned short __attribute__ ((progmem)) TimerRTCPrescaleFactor[] = {0,1,8,32,64,128,256,1024}; |
// Global variables |
// time registers |
volatile unsigned long TimerPauseReg; |
volatile unsigned long Timer0Reg0; |
volatile unsigned long Timer2Reg0; |
typedef void (*voidFuncPtr)(void); |
volatile static voidFuncPtr TimerIntFunc[TIMER_NUM_INTERRUPTS]; |
// delay for a minimum of <us> microseconds |
// the time resolution is dependent on the time the loop takes |
// e.g. with 4Mhz and 5 cycles per loop, the resolution is 1.25 us |
void delay_us(unsigned short time_us) |
{ |
unsigned short delay_loops; |
register unsigned short i; |
delay_loops = (time_us+3)/5*CYCLES_PER_US; // +3 for rounding up (dirty) |
// one loop takes 5 cpu cycles |
for (i=0; i < delay_loops; i++) {}; |
} |
/* |
void delay_ms(unsigned char time_ms) |
{ |
unsigned short delay_count = F_CPU / 4000; |
unsigned short cnt; |
asm volatile ("\n" |
"L_dl1%=:\n\t" |
"mov %A0, %A2\n\t" |
"mov %B0, %B2\n" |
"L_dl2%=:\n\t" |
"sbiw %A0, 1\n\t" |
"brne L_dl2%=\n\t" |
"dec %1\n\t" "brne L_dl1%=\n\t":"=&w" (cnt) |
:"r"(time_ms), "r"((unsigned short) (delay_count)) |
); |
} |
*/ |
void timerInit(void) |
{ |
u08 intNum; |
// detach all user functions from interrupts |
for(intNum=0; intNum<TIMER_NUM_INTERRUPTS; intNum++) |
timerDetach(intNum); |
// initialize all timers |
timer0Init(); |
timer1Init(); |
#ifdef TCNT2 // support timer2 only if it exists |
timer2Init(); |
#endif |
// enable interrupts |
sei(); |
} |
void timer0Init() |
{ |
// initialize timer 0 |
timer0SetPrescaler( TIMER0PRESCALE ); // set prescaler |
outb(TCNT0, 0); // reset TCNT0 |
sbi(TIMSK, TOIE0); // enable TCNT0 overflow interrupt |
timer0ClearOverflowCount(); // initialize time registers |
} |
void timer1Init(void) |
{ |
// initialize timer 1 |
timer1SetPrescaler( TIMER1PRESCALE ); // set prescaler |
outb(TCNT1H, 0); // reset TCNT1 |
outb(TCNT1L, 0); |
sbi(TIMSK, TOIE1); // enable TCNT1 overflow |
} |
#ifdef TCNT2 // support timer2 only if it exists |
void timer2Init(void) |
{ |
// initialize timer 2 |
timer2SetPrescaler( TIMER2PRESCALE ); // set prescaler |
outb(TCNT2, 0); // reset TCNT2 |
sbi(TIMSK, TOIE2); // enable TCNT2 overflow |
timer2ClearOverflowCount(); // initialize time registers |
} |
#endif |
void timer0SetPrescaler(u08 prescale) |
{ |
// set prescaler on timer 0 |
outb(TCCR0, (inb(TCCR0) & ~TIMER_PRESCALE_MASK) | prescale); |
} |
void timer1SetPrescaler(u08 prescale) |
{ |
// set prescaler on timer 1 |
outb(TCCR1B, (inb(TCCR1B) & ~TIMER_PRESCALE_MASK) | prescale); |
} |
#ifdef TCNT2 // support timer2 only if it exists |
void timer2SetPrescaler(u08 prescale) |
{ |
// set prescaler on timer 2 |
outb(TCCR2, (inb(TCCR2) & ~TIMER_PRESCALE_MASK) | prescale); |
} |
#endif |
u16 timer0GetPrescaler(void) |
{ |
// get the current prescaler setting |
return (pgm_read_word(TimerPrescaleFactor+(inb(TCCR0) & TIMER_PRESCALE_MASK))); |
} |
u16 timer1GetPrescaler(void) |
{ |
// get the current prescaler setting |
return (pgm_read_word(TimerPrescaleFactor+(inb(TCCR1B) & TIMER_PRESCALE_MASK))); |
} |
#ifdef TCNT2 // support timer2 only if it exists |
u16 timer2GetPrescaler(void) |
{ |
//TODO: can we assume for all 3-timer AVR processors, |
// that timer2 is the RTC timer? |
// get the current prescaler setting |
return (pgm_read_word(TimerRTCPrescaleFactor+(inb(TCCR2) & TIMER_PRESCALE_MASK))); |
} |
#endif |
void timerAttach(u08 interruptNum, void (*userFunc)(void) ) |
{ |
// make sure the interrupt number is within bounds |
if(interruptNum < TIMER_NUM_INTERRUPTS) |
{ |
// set the interrupt function to run |
// the supplied user's function |
TimerIntFunc[interruptNum] = userFunc; |
} |
} |
void timerDetach(u08 interruptNum) |
{ |
// make sure the interrupt number is within bounds |
if(interruptNum < TIMER_NUM_INTERRUPTS) |
{ |
// set the interrupt function to run nothing |
TimerIntFunc[interruptNum] = 0; |
} |
} |
/* |
u32 timerMsToTics(u16 ms) |
{ |
// calculate the prescaler division rate |
u16 prescaleDiv = 1<<(pgm_read_byte(TimerPrescaleFactor+inb(TCCR0))); |
// calculate the number of timer tics in x milliseconds |
return (ms*(F_CPU/(prescaleDiv*256)))/1000; |
} |
u16 timerTicsToMs(u32 tics) |
{ |
// calculate the prescaler division rate |
u16 prescaleDiv = 1<<(pgm_read_byte(TimerPrescaleFactor+inb(TCCR0))); |
// calculate the number of milliseconds in x timer tics |
return (tics*1000*(prescaleDiv*256))/F_CPU; |
} |
*/ |
void timerPause(unsigned short pause_ms) |
{ |
// pauses for exactly <pause_ms> number of milliseconds |
u08 timerThres; |
u32 ticRateHz; |
u32 pause; |
// capture current pause timer value |
timerThres = inb(TCNT0); |
// reset pause timer overflow count |
TimerPauseReg = 0; |
// calculate delay for [pause_ms] milliseconds |
// prescaler division = 1<<(pgm_read_byte(TimerPrescaleFactor+inb(TCCR0))) |
ticRateHz = F_CPU/timer0GetPrescaler(); |
// precision management |
// prevent overflow and precision underflow |
// -could add more conditions to improve accuracy |
if( ((ticRateHz < 429497) && (pause_ms <= 10000)) ) |
pause = (pause_ms*ticRateHz)/1000; |
else |
pause = pause_ms*(ticRateHz/1000); |
// loop until time expires |
while( ((TimerPauseReg<<8) | inb(TCNT0)) < (pause+timerThres) ) |
{ |
if( TimerPauseReg < (pause>>8)); |
{ |
// save power by idling the processor |
set_sleep_mode(SLEEP_MODE_IDLE); |
sleep_mode(); |
} |
} |
/* old inaccurate code, for reference |
// calculate delay for [pause_ms] milliseconds |
u16 prescaleDiv = 1<<(pgm_read_byte(TimerPrescaleFactor+inb(TCCR0))); |
u32 pause = (pause_ms*(F_CPU/(prescaleDiv*256)))/1000; |
TimerPauseReg = 0; |
while(TimerPauseReg < pause); |
*/ |
} |
void timer0ClearOverflowCount(void) |
{ |
// clear the timer overflow counter registers |
Timer0Reg0 = 0; // initialize time registers |
} |
long timer0GetOverflowCount(void) |
{ |
// return the current timer overflow count |
// (this is since the last timer0ClearOverflowCount() command was called) |
return Timer0Reg0; |
} |
#ifdef TCNT2 // support timer2 only if it exists |
void timer2ClearOverflowCount(void) |
{ |
// clear the timer overflow counter registers |
Timer2Reg0 = 0; // initialize time registers |
} |
long timer2GetOverflowCount(void) |
{ |
// return the current timer overflow count |
// (this is since the last timer2ClearOverflowCount() command was called) |
return Timer2Reg0; |
} |
#endif |
void timer1PWMInit(u08 bitRes) |
{ |
// configures timer1 for use with PWM output |
// on OC1A and OC1B pins |
// enable timer1 as 8,9,10bit PWM |
if(bitRes == 9) |
{ // 9bit mode |
sbi(TCCR1A,PWM11); |
cbi(TCCR1A,PWM10); |
} |
else if( bitRes == 10 ) |
{ // 10bit mode |
sbi(TCCR1A,PWM11); |
sbi(TCCR1A,PWM10); |
} |
else |
{ // default 8bit mode |
cbi(TCCR1A,PWM11); |
sbi(TCCR1A,PWM10); |
} |
// clear output compare value A |
outb(OCR1AH, 0); |
outb(OCR1AL, 0); |
// clear output compare value B |
outb(OCR1BH, 0); |
outb(OCR1BL, 0); |
} |
#ifdef WGM10 |
// include support for arbitrary top-count PWM |
// on new AVR processors that support it |
void timer1PWMInitICR(u16 topcount) |
{ |
// set PWM mode with ICR top-count |
cbi(TCCR1A,WGM10); |
sbi(TCCR1A,WGM11); |
sbi(TCCR1B,WGM12); |
sbi(TCCR1B,WGM13); |
// set top count value |
ICR1 = topcount; |
// clear output compare value A |
OCR1A = 0; |
// clear output compare value B |
OCR1B = 0; |
} |
#endif |
void timer1PWMOff(void) |
{ |
// turn off timer1 PWM mode |
cbi(TCCR1A,PWM11); |
cbi(TCCR1A,PWM10); |
// set PWM1A/B (OutputCompare action) to none |
timer1PWMAOff(); |
timer1PWMBOff(); |
} |
void timer1PWMAOn(void) |
{ |
// turn on channel A (OC1A) PWM output |
// set OC1A as non-inverted PWM |
sbi(TCCR1A,COM1A1); |
cbi(TCCR1A,COM1A0); |
} |
void timer1PWMBOn(void) |
{ |
// turn on channel B (OC1B) PWM output |
// set OC1B as non-inverted PWM |
sbi(TCCR1A,COM1B1); |
cbi(TCCR1A,COM1B0); |
} |
void timer1PWMAOff(void) |
{ |
// turn off channel A (OC1A) PWM output |
// set OC1A (OutputCompare action) to none |
cbi(TCCR1A,COM1A1); |
cbi(TCCR1A,COM1A0); |
} |
void timer1PWMBOff(void) |
{ |
// turn off channel B (OC1B) PWM output |
// set OC1B (OutputCompare action) to none |
cbi(TCCR1A,COM1B1); |
cbi(TCCR1A,COM1B0); |
} |
void timer1PWMASet(u16 pwmDuty) |
{ |
// set PWM (output compare) duty for channel A |
// this PWM output is generated on OC1A pin |
// NOTE: pwmDuty should be in the range 0-255 for 8bit PWM |
// pwmDuty should be in the range 0-511 for 9bit PWM |
// pwmDuty should be in the range 0-1023 for 10bit PWM |
//outp( (pwmDuty>>8), OCR1AH); // set the high 8bits of OCR1A |
//outp( (pwmDuty&0x00FF), OCR1AL); // set the low 8bits of OCR1A |
OCR1A = pwmDuty; |
} |
void timer1PWMBSet(u16 pwmDuty) |
{ |
// set PWM (output compare) duty for channel B |
// this PWM output is generated on OC1B pin |
// NOTE: pwmDuty should be in the range 0-255 for 8bit PWM |
// pwmDuty should be in the range 0-511 for 9bit PWM |
// pwmDuty should be in the range 0-1023 for 10bit PWM |
//outp( (pwmDuty>>8), OCR1BH); // set the high 8bits of OCR1B |
//outp( (pwmDuty&0x00FF), OCR1BL); // set the low 8bits of OCR1B |
OCR1B = pwmDuty; |
} |
//! Interrupt handler for tcnt0 overflow interrupt |
TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW0) |
{ |
Timer0Reg0++; // increment low-order counter |
// increment pause counter |
TimerPauseReg++; |
// if a user function is defined, execute it too |
if(TimerIntFunc[TIMER0OVERFLOW_INT]) |
TimerIntFunc[TIMER0OVERFLOW_INT](); |
} |
//! Interrupt handler for tcnt1 overflow interrupt |
TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW1) |
{ |
// if a user function is defined, execute it |
if(TimerIntFunc[TIMER1OVERFLOW_INT]) |
TimerIntFunc[TIMER1OVERFLOW_INT](); |
} |
#ifdef TCNT2 // support timer2 only if it exists |
//! Interrupt handler for tcnt2 overflow interrupt |
TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW2) |
{ |
Timer2Reg0++; // increment low-order counter |
// if a user function is defined, execute it |
if(TimerIntFunc[TIMER2OVERFLOW_INT]) |
TimerIntFunc[TIMER2OVERFLOW_INT](); |
} |
#endif |
#ifdef OCR0 |
// include support for Output Compare 0 for new AVR processors that support it |
//! Interrupt handler for OutputCompare0 match (OC0) interrupt |
TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE0) |
{ |
// if a user function is defined, execute it |
if(TimerIntFunc[TIMER0OUTCOMPARE_INT]) |
TimerIntFunc[TIMER0OUTCOMPARE_INT](); |
} |
#endif |
//! Interrupt handler for CutputCompare1A match (OC1A) interrupt |
TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE1A) |
{ |
// if a user function is defined, execute it |
if(TimerIntFunc[TIMER1OUTCOMPAREA_INT]) |
TimerIntFunc[TIMER1OUTCOMPAREA_INT](); |
} |
//! Interrupt handler for OutputCompare1B match (OC1B) interrupt |
TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE1B) |
{ |
// if a user function is defined, execute it |
if(TimerIntFunc[TIMER1OUTCOMPAREB_INT]) |
TimerIntFunc[TIMER1OUTCOMPAREB_INT](); |
} |
//! Interrupt handler for InputCapture1 (IC1) interrupt |
TIMER_INTERRUPT_HANDLER(SIG_INPUT_CAPTURE1) |
{ |
// if a user function is defined, execute it |
if(TimerIntFunc[TIMER1INPUTCAPTURE_INT]) |
TimerIntFunc[TIMER1INPUTCAPTURE_INT](); |
} |
//! Interrupt handler for OutputCompare2 match (OC2) interrupt |
TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE2) |
{ |
// if a user function is defined, execute it |
if(TimerIntFunc[TIMER2OUTCOMPARE_INT]) |
TimerIntFunc[TIMER2OUTCOMPARE_INT](); |
} |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer/timer.h |
---|
0,0 → 1,314 |
/*! \file timer.h \brief System Timer function library. */ |
//***************************************************************************** |
// |
// File Name : 'timer.h' |
// Title : System Timer function library |
// Author : Pascal Stang - Copyright (C) 2000-2002 |
// Created : 11/22/2000 |
// Revised : 02/10/2003 |
// Version : 1.1 |
// Target MCU : Atmel AVR Series |
// Editor Tabs : 4 |
// |
// This code is distributed under the GNU Public License |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
// |
/// \ingroup driver_avr |
/// \defgroup timer Timer Function Library (timer.c) |
/// \code #include "timer.h" \endcode |
/// \par Overview |
/// This library provides functions for use with the timers internal |
/// to the AVR processors. Functions include initialization, set prescaler, |
/// calibrated pause function (in milliseconds), attaching and detaching of |
/// user functions to interrupts, overflow counters, PWM. Arbitrary |
/// frequency generation has been moved to the Pulse Library. |
/// |
/// \par About Timers |
/// The Atmel AVR-series processors each contain at least one |
/// hardware timer/counter. Many of the processors contain 2 or 3 |
/// timers. Generally speaking, a timer is a hardware counter inside |
/// the processor which counts at a rate related to the main CPU clock |
/// frequency. Because the counter value increasing (counting up) at |
/// a precise rate, we can use it as a timer to create or measure |
/// precise delays, schedule events, or generate signals of a certain |
/// frequency or pulse-width. |
/// \par |
/// As an example, the ATmega163 processor has 3 timer/counters. |
/// Timer0, Timer1, and Timer2 are 8, 16, and 8 bits wide respectively. |
/// This means that they overflow, or roll over back to zero, at a |
/// count value of 256 for 8bits or 65536 for 16bits. A prescaler is |
/// avaiable for each timer, and the prescaler allows you to pre-divide |
/// the main CPU clock rate down to a slower speed before feeding it to |
/// the counting input of a timer. For example, if the CPU clock |
/// frequency is 3.69MHz, and Timer0's prescaler is set to divide-by-8, |
/// then Timer0 will "tic" at 3690000/8 = 461250Hz. Because Timer0 is |
/// an 8bit timer, it will count to 256 in just 256/461250Hz = 0.555ms. |
/// In fact, when it hits 255, it will overflow and start again at |
/// zero. In this case, Timer0 will overflow 461250/256 = 1801.76 |
/// times per second. |
/// \par |
/// Timer0 can be used a number of ways simultaneously. First, the |
/// value of the timer can be read by accessing the CPU register \c TCNT0. |
/// We could, for example, figure out how long it takes to execute a |
/// C command by recording the value of \c TCNT0 before and after |
/// execution, then subtract (after-before) = time elapsed. Or we can |
/// enable the overflow interrupt which goes off every time T0 |
/// overflows and count out longer delays (multiple overflows), or |
/// execute a special periodic function at every overflow. |
/// \par |
/// The other timers (Timer1 and Timer2) offer all the abilities of |
/// Timer0 and many more features. Both T1 and T2 can operate as |
/// general-purpose timers, but T1 has special hardware allowing it to |
/// generate PWM signals, while T2 is specially designed to help count |
/// out real time (like hours, minutes, seconds). See the |
/// Timer/Counter section of the processor datasheet for more info. |
/// |
//***************************************************************************** |
//@{ |
#ifndef TIMER_H |
#define TIMER_H |
#include "global.h" |
// constants/macros/typdefs |
// processor compatibility fixes |
#ifdef __AVR_ATmega323__ |
// redefinition for the Mega323 |
#define CTC1 CTC10 |
#endif |
#ifndef PWM10 |
// mega128 PWM bits |
#define PWM10 WGM10 |
#define PWM11 WGM11 |
#endif |
// Timer/clock prescaler values and timer overflow rates |
// tics = rate at which the timer counts up |
// 8bitoverflow = rate at which the timer overflows 8bits (or reaches 256) |
// 16bit [overflow] = rate at which the timer overflows 16bits (65536) |
// |
// overflows can be used to generate periodic interrupts |
// |
// for 8MHz crystal |
// 0 = STOP (Timer not counting) |
// 1 = CLOCK tics= 8MHz 8bitoverflow= 31250Hz 16bit= 122.070Hz |
// 2 = CLOCK/8 tics= 1MHz 8bitoverflow= 3906.25Hz 16bit= 15.259Hz |
// 3 = CLOCK/64 tics= 125kHz 8bitoverflow= 488.28Hz 16bit= 1.907Hz |
// 4 = CLOCK/256 tics= 31250Hz 8bitoverflow= 122.07Hz 16bit= 0.477Hz |
// 5 = CLOCK/1024 tics= 7812.5Hz 8bitoverflow= 30.52Hz 16bit= 0.119Hz |
// 6 = External Clock on T(x) pin (falling edge) |
// 7 = External Clock on T(x) pin (rising edge) |
// for 4MHz crystal |
// 0 = STOP (Timer not counting) |
// 1 = CLOCK tics= 4MHz 8bitoverflow= 15625Hz 16bit= 61.035Hz |
// 2 = CLOCK/8 tics= 500kHz 8bitoverflow= 1953.125Hz 16bit= 7.629Hz |
// 3 = CLOCK/64 tics= 62500Hz 8bitoverflow= 244.141Hz 16bit= 0.954Hz |
// 4 = CLOCK/256 tics= 15625Hz 8bitoverflow= 61.035Hz 16bit= 0.238Hz |
// 5 = CLOCK/1024 tics= 3906.25Hz 8bitoverflow= 15.259Hz 16bit= 0.060Hz |
// 6 = External Clock on T(x) pin (falling edge) |
// 7 = External Clock on T(x) pin (rising edge) |
// for 3.69MHz crystal |
// 0 = STOP (Timer not counting) |
// 1 = CLOCK tics= 3.69MHz 8bitoverflow= 14414Hz 16bit= 56.304Hz |
// 2 = CLOCK/8 tics= 461250Hz 8bitoverflow= 1801.758Hz 16bit= 7.038Hz |
// 3 = CLOCK/64 tics= 57625.25Hz 8bitoverflow= 225.220Hz 16bit= 0.880Hz |
// 4 = CLOCK/256 tics= 14414.063Hz 8bitoverflow= 56.305Hz 16bit= 0.220Hz |
// 5 = CLOCK/1024 tics= 3603.516Hz 8bitoverflow= 14.076Hz 16bit= 0.055Hz |
// 6 = External Clock on T(x) pin (falling edge) |
// 7 = External Clock on T(x) pin (rising edge) |
// for 32.768KHz crystal on timer 2 (use for real-time clock) |
// 0 = STOP |
// 1 = CLOCK tics= 32.768kHz 8bitoverflow= 128Hz |
// 2 = CLOCK/8 tics= 4096kHz 8bitoverflow= 16Hz |
// 3 = CLOCK/32 tics= 1024kHz 8bitoverflow= 4Hz |
// 4 = CLOCK/64 tics= 512Hz 8bitoverflow= 2Hz |
// 5 = CLOCK/128 tics= 256Hz 8bitoverflow= 1Hz |
// 6 = CLOCK/256 tics= 128Hz 8bitoverflow= 0.5Hz |
// 7 = CLOCK/1024 tics= 32Hz 8bitoverflow= 0.125Hz |
#define TIMER_CLK_STOP 0x00 ///< Timer Stopped |
#define TIMER_CLK_DIV1 0x01 ///< Timer clocked at F_CPU |
#define TIMER_CLK_DIV8 0x02 ///< Timer clocked at F_CPU/8 |
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 |
#define TIMER_CLK_DIV256 0x04 ///< Timer clocked at F_CPU/256 |
#define TIMER_CLK_DIV1024 0x05 ///< Timer clocked at F_CPU/1024 |
#define TIMER_CLK_T_FALL 0x06 ///< Timer clocked at T falling edge |
#define TIMER_CLK_T_RISE 0x07 ///< Timer clocked at T rising edge |
#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask |
#define TIMERRTC_CLK_STOP 0x00 ///< RTC Timer Stopped |
#define TIMERRTC_CLK_DIV1 0x01 ///< RTC Timer clocked at F_CPU |
#define TIMERRTC_CLK_DIV8 0x02 ///< RTC Timer clocked at F_CPU/8 |
#define TIMERRTC_CLK_DIV32 0x03 ///< RTC Timer clocked at F_CPU/32 |
#define TIMERRTC_CLK_DIV64 0x04 ///< RTC Timer clocked at F_CPU/64 |
#define TIMERRTC_CLK_DIV128 0x05 ///< RTC Timer clocked at F_CPU/128 |
#define TIMERRTC_CLK_DIV256 0x06 ///< RTC Timer clocked at F_CPU/256 |
#define TIMERRTC_CLK_DIV1024 0x07 ///< RTC Timer clocked at F_CPU/1024 |
#define TIMERRTC_PRESCALE_MASK 0x07 ///< RTC Timer Prescaler Bit-Mask |
// default prescale settings for the timers |
// these settings are applied when you call |
// timerInit or any of the timer<x>Init |
#define TIMER0PRESCALE TIMER_CLK_DIV8 ///< timer 0 prescaler default |
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default |
#define TIMER2PRESCALE TIMERRTC_CLK_DIV64 ///< timer 2 prescaler default |
// interrupt macros for attaching user functions to timer interrupts |
// use these with timerAttach( intNum, function ) |
#define TIMER0OVERFLOW_INT 0 |
#define TIMER1OVERFLOW_INT 1 |
#define TIMER1OUTCOMPAREA_INT 2 |
#define TIMER1OUTCOMPAREB_INT 3 |
#define TIMER1INPUTCAPTURE_INT 4 |
#define TIMER2OVERFLOW_INT 5 |
#define TIMER2OUTCOMPARE_INT 6 |
#ifdef OCR0 // for processors that support output compare on Timer0 |
#define TIMER0OUTCOMPARE_INT 7 |
#define TIMER_NUM_INTERRUPTS 8 |
#else |
#define TIMER_NUM_INTERRUPTS 7 |
#endif |
// default type of interrupt handler to use for timers |
// *do not change unless you know what you're doing |
// Value may be SIGNAL or INTERRUPT |
#ifndef TIMER_INTERRUPT_HANDLER |
#define TIMER_INTERRUPT_HANDLER SIGNAL |
#endif |
// functions |
#define delay delay_us |
#define delay_ms timerPause |
void delay_us(unsigned short time_us); |
//! initializes timing system (all timers) |
// runs all timer init functions |
// sets all timers to default prescale values #defined in systimer.c |
void timerInit(void); |
// default initialization routines for each timer |
void timer0Init(void); ///< initialize timer0 |
void timer1Init(void); ///< initialize timer1 |
#ifdef TCNT2 // support timer2 only if it exists |
void timer2Init(void); ///< initialize timer2 |
#endif |
// Clock prescaler set/get commands for each timer/counter |
// For setting the prescaler, you should use one of the #defines |
// above like TIMER_CLK_DIVx, where [x] is the division rate |
// you want. |
// When getting the current prescaler setting, the return value |
// will be the [x] division value currently set. |
void timer0SetPrescaler(u08 prescale); ///< set timer0 prescaler |
u16 timer0GetPrescaler(void); ///< get timer0 prescaler |
void timer1SetPrescaler(u08 prescale); ///< set timer1 prescaler |
u16 timer1GetPrescaler(void); ///< get timer0 prescaler |
#ifdef TCNT2 // support timer2 only if it exists |
void timer2SetPrescaler(u08 prescale); ///< set timer2 prescaler |
u16 timer2GetPrescaler(void); ///< get timer2 prescaler |
#endif |
// TimerAttach and Detach commands |
// These functions allow the attachment (or detachment) of any user function |
// to a timer interrupt. "Attaching" one of your own functions to a timer |
// interrupt means that it will be called whenever that interrupt happens. |
// Using attach is better than rewriting the actual INTERRUPT() function |
// because your code will still work and be compatible if the timer library |
// is updated. Also, using Attach allows your code and any predefined timer |
// code to work together and at the same time. (ie. "attaching" your own |
// function to the timer0 overflow doesn't prevent timerPause from working, |
// but rather allows you to share the interrupt.) |
// |
// timerAttach(TIMER1OVERFLOW_INT, myOverflowFunction); |
// timerDetach(TIMER1OVERFLOW_INT) |
// |
// timerAttach causes the myOverflowFunction() to be attached, and therefore |
// execute, whenever an overflow on timer1 occurs. timerDetach removes the |
// association and executes no user function when the interrupt occurs. |
// myOverflowFunction must be defined with no return value and no arguments: |
// |
// void myOverflowFunction(void) { ... } |
//! Attach a user function to a timer interrupt |
void timerAttach(u08 interruptNum, void (*userFunc)(void) ); |
//! Detach a user function from a timer interrupt |
void timerDetach(u08 interruptNum); |
// timing commands |
/// A timer-based delay/pause function |
/// @param pause_ms Number of integer milliseconds to wait. |
void timerPause(unsigned short pause_ms); |
// overflow counters |
void timer0ClearOverflowCount(void); ///< Clear timer0's overflow counter. |
long timer0GetOverflowCount(void); ///< read timer0's overflow counter |
#ifdef TCNT2 // support timer2 only if it exists |
void timer2ClearOverflowCount(void); ///< clear timer2's overflow counter |
long timer2GetOverflowCount(void); ///< read timer0's overflow counter |
#endif |
/// @defgroup timerpwm Timer PWM Commands |
/// @ingroup timer |
/// These commands control PWM functionality on timer1 |
// PWM initialization and set commands for timer1 |
// timer1PWMInit() |
// configures the timer1 hardware for PWM mode on pins OC1A and OC1B. |
// bitRes should be 8,9,or 10 for 8,9,or 10bit PWM resolution |
// |
// timer1PWMOff() |
// turns off all timer1 PWM output and set timer mode to normal state |
// |
// timer1PWMAOn() and timer1PWMBOn() |
// turn on output of PWM signals to OC1A or OC1B pins |
// NOTE: Until you define the OC1A and OC1B pins as outputs, and run |
// this "on" command, no PWM output will be output |
// |
// timer1PWMAOff() and timer1PWMBOff() |
// turn off output of PWM signals to OC1A or OC1B pins |
// |
// timer1PWMASet() and timer1PWMBSet() |
// sets the PWM duty cycle for each channel |
// NOTE: <pwmDuty> should be in the range 0-255 for 8bit PWM |
// <pwmDuty> should be in the range 0-511 for 9bit PWM |
// <pwmDuty> should be in the range 0-1023 for 10bit PWM |
// NOTE: the PWM frequency can be controlled in increments by setting the |
// prescaler for timer1 |
//@{ |
/// Enter standard PWM Mode on timer1. |
/// \param bitRes indicates the period/resolution to use for PWM output in timer bits. |
/// Must be either 8, 9, or 10 bits corresponding to PWM periods of 256, 512, or 1024 timer tics. |
void timer1PWMInit(u08 bitRes); |
/// Enter PWM Mode on timer1 with a specific top-count value. |
/// \param topcount indicates the desired PWM period in timer tics. |
/// Can be a number between 1 and 65535 (16-bit). |
void timer1PWMInitICR(u16 topcount); |
/// Turn off all timer1 PWM output and set timer mode to normal. |
void timer1PWMOff(void); |
/// Turn on/off Timer1 PWM outputs. |
void timer1PWMAOn(void); ///< Turn on timer1 Channel A (OC1A) PWM output. |
void timer1PWMBOn(void); ///< Turn on timer1 Channel B (OC1B) PWM output. |
void timer1PWMAOff(void); ///< turn off timer1 Channel A (OC1A) PWM output |
void timer1PWMBOff(void); ///< turn off timer1 Channel B (OC1B) PWM output |
void timer1PWMASet(u16 pwmDuty); ///< set duty of timer1 Channel A (OC1A) PWM output |
void timer1PWMBSet(u16 pwmDuty); ///< set duty of timer1 Channel B (OC1B) PWM output |
//@} |
//@} |
// Pulse generation commands have been moved to the pulse.c library |
#endif |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
/programy/C/avr/inclinometer |
---|
Property changes: |
Added: svn:mergeinfo |