Compare commits

..

10 Commits

10525 changed files with 41 additions and 710525 deletions

68
README
View File

@ -1,31 +1,45 @@
Welcome to the Flukso repository.
This git repo contains the code needed for builing an OpenWRT Kamikaze-based
firmware for the Fluksometer v1, aka FLM01.
The repository is structured as follows:
* mote/v[1|2]/openwrt
The modules, patches and scripts needed to tailor a stock OpenWRT Backfire to
the Fluksometer hardware. The bulk of development will now be taking place in
the v2 directory which maps to the v2 hardware.
* mote/v[1|2]/eagle
The Eagle schematic, board and BOM files for building a v1 or v2 Flukso sensor
board.
* mote/v[1|2]/avr
The AVR microcontroller code for the Flukso sensor board.
* server/api
The Erlang/Webmachine code that handles the Flukso server's JSON/REST API.
* server/drupal
Custom Drupal v6 modules that transform a Drupal 6 installation into a community
metering web platform, see a.o. www.flukso.net or www.mysmartgrid.de.
tree:
.
|-- avr
| `-- wiring
|-- eagle
| `-- prj
| |-- flukso.sensor.board.v1
| |-- flukso.sensor.board.v1.1
| `-- flukso.sensor.board.v1.2
`-- openwrt
|-- files
| `-- etc
|-- package
| |-- avahi
| |-- button
| |-- expat
| |-- flukso
| |-- gdbm
| |-- intltool
| |-- libdaemon
| |-- luaexpat
| |-- luasocket
| |-- luaxmlrpc
| |-- luaxyssl
| |-- luci
| |-- ntpclient
| `-- xyssl
`-- patches
avr: AVR microcontroller code for the v2 Flukso sensor board
eagle: Eagle schematic, board and BOM files for building a v2 Flukso sensor
board
openwrt: the modules, patches and scripts needed to tailor a stock OpenWRT
Backfire to the Fluksometer hardware.
For more information about this project and to see the code in action, surf to
www.flukso.net.
$forum = www.flukso.net/forum
$mailing_list = flukso-dev-join@lists.flukso.net
$irc = #flukso on freenode
Interested in contributing code- or schematic-wise? Then please join the
flukso-dev mailing list.
You can sign up via the web: http://lists.flukso.net/mailman/listinfo/flukso-dev.
Or simply drop a mail to this address: flukso-dev-join@lists.flukso.net.
You can also harass us via IRC in the #flukso channel on freenode.
Happy metering!
Bart.

View File

@ -1,83 +0,0 @@
//
// avrlibdefs.h : AVRlib global defines and macros include file
//
// Copyright (c) 2001-2002 Pascal Stang
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#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

View File

@ -1,84 +0,0 @@
//
// avrlibtypes.h : AVRlib global types and typedefines include file
//
// Copyright (c) 2001-2002 Pascal Stang
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#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

View File

@ -1,269 +0,0 @@
//
// basiciotest.c : test code for the io and buffer ops of the UART and SPI ports
//
// Copyright (c) 2010 flukso.net
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include <util/delay.h>
#include "uart.h"
#include "spi.h"
#include "ctrl.h"
#define NO_OP_1 1
#define NO_OP_2 2
#define START_TX 4
#define TRANSMIT 8
#define HIGH_HEX 16
#define TO_FROM_UART 32
#define NEW_CTRL_MSG 64
#define SPI_END_OF_TX 0x00
#define SPI_END_OF_MESSAGE '.'
#define SPI_FORWARD_TO_UART_PORT 'u'
#define SPI_FORWARD_TO_CTRL_PORT 'l' // 'l'ocal port
volatile uint8_t spi_status, high_hex;
// hex to binary/byte decoding
uint8_t htob(uint16_t hex)
{
uint8_t low_hex = (uint8_t) hex;
uint8_t high_hex = (uint8_t) (hex >> 8);
uint8_t byte;
byte = (high_hex > 0x40) ? (high_hex & 0x0F) + 9 : high_hex & 0x0F;
byte = byte << 4;
byte |= (low_hex > 0x40) ? (low_hex & 0x0F) + 9 : low_hex & 0x0F;
return byte;
}
// binary/byte to hex encoding
uint16_t btoh(uint8_t byte)
{
uint8_t low_nibble = (byte & 0x0F);
uint8_t high_nibble = (byte & 0xF0) >> 4;
uint16_t hex;
hex = (high_nibble > 0x09) ? high_nibble - 9 + 0x60 : high_nibble + 0x30;
hex = hex << 8;
hex |= (low_nibble > 0x09) ? low_nibble - 9 + 0x60 : low_nibble + 0x30;
return hex;
}
ISR(SPI_STC_vect)
{
uint8_t spi_rx, rx, tx;
uint16_t spi_tx;
// the SPI is double-buffered, requiring two NO_OPs when switching from Tx to Rx
if (spi_status & (NO_OP_1 | NO_OP_2)) {
spi_status--;
return;
}
// do we have to transmit the first byte?
if (spi_status & START_TX) {
received_from_spi(SPI_FORWARD_TO_CTRL_PORT);
spi_status &= ~START_TX;
return;
}
// are we in Tx mode?
if (spi_status & TRANSMIT) {
if (spi_status & HIGH_HEX) {
received_from_spi(high_hex);
spi_status &= ~HIGH_HEX;
return;
}
if (spi_status & TO_FROM_UART) {
if (!uartReceiveByte(&tx)) {
received_from_spi(SPI_END_OF_TX);
spi_status &= ~TRANSMIT;
spi_status |= NO_OP_2;
return;
}
}
else {
if (ctrlGetFromTxBuffer(&tx)) {
if (tx == SPI_END_OF_MESSAGE) {
received_from_spi(tx);
return;
}
}
else {
received_from_spi(SPI_FORWARD_TO_UART_PORT);
spi_status |= TO_FROM_UART;
return;
}
}
spi_tx = btoh(tx);
high_hex = (uint8_t)spi_tx;
spi_status |= HIGH_HEX;
received_from_spi((uint8_t)(spi_tx >> 8));
return;
}
// we're in Rx mode
switch (spi_rx = received_from_spi(0x00)) {
case SPI_END_OF_TX:
spi_status |= TRANSMIT | START_TX;
spi_status &= ~(HIGH_HEX | TO_FROM_UART);
break;
case SPI_END_OF_MESSAGE:
if (!(spi_status & TO_FROM_UART)) {
ctrlAddToRxBuffer(spi_rx);
spi_status |= NEW_CTRL_MSG;
}
break;
case SPI_FORWARD_TO_UART_PORT:
spi_status |= TO_FROM_UART;
break;
case SPI_FORWARD_TO_CTRL_PORT:
spi_status &= ~TO_FROM_UART;
break;
default:
if (spi_status & HIGH_HEX) {
rx = htob(((uint16_t)high_hex << 8) + spi_rx);
if (spi_status & TO_FROM_UART) {
uartAddToTxBuffer(rx);
}
else {
ctrlAddToRxBuffer(rx);
}
}
else {
high_hex = spi_rx;
}
// toggle the HEX bit in spi_status
spi_status ^= HIGH_HEX;
}
}
ISR(TIMER1_COMPA_vect)
{
/* void */
}
ISR(ANALOG_COMP_vect)
{
uint8_t i;
PORTB |= (1<<PB0);
//disable uC sections to consume less power while writing to EEPROM
//disable UART Tx and Rx:
UCSR0B &= ~((1<<RXEN0) | (1<<TXEN0));
//disable ADC:
ADCSRA &= ~(1<<ADEN);
for (i=0; i<128; i++)
eeprom_write_byte((uint8_t *)i, i);
//enable UART Tx and Rx:
UCSR0B |= (1<<RXEN0) | (1<<TXEN0);
// enable ADC and start a first ADC conversion
ADCSRA |= (1<<ADEN) | (1<<ADSC);
PORTB &= ~(1<<PB0);
}
void setup_pulse_input(void)
{
// PD2=INT0 and PD3=INT1 configuration
// set as input pin with 20k pull-up enabled
PORTD |= (1<<PD2) | (1<<PD3);
// INT0 and INT1 to trigger an interrupt on a falling edge
EICRA = (1<<ISC01) | (1<<ISC11);
// enable INT0 and INT1 interrupts
EIMSK = (1<<INT0) | (1<<INT1);
}
void setup_timer1(void)
{
// Timer1 clock prescaler set to 1 => fTOV1 = 3686.4kHz / 65536 = 56.25Hz (DS p.134)
TCCR1B |= (1<<CS10);
// Increase sampling frequency to 2kHz (= 667Hz per channel) with an error of 0.01% (DS p.122)
OCR1A = 0x0732;
// Timer1 set to CTC mode (DS p.133)
TCCR1B |= 1<<WGM12;
// Enable output compare match interrupt for timer1 (DS p.136)
TIMSK1 |= (1<<OCIE1A);
#if DBG > 0
// Set PB1=OC1A as output pin
DDRB |= (1<<DDB1);
// Toggle pin OC1A=PB1 on compare match
TCCR1A |= 1<<COM1A0;
#endif
}
void setup_analog_comparator(void)
{
// analog comparator setup for brown-out detection
// PD7=AIN1 configured by default as input to obtain high impedance
// disable digital input cicuitry on AIN0 and AIN1 pins to reduce leakage current
DIDR1 |= (1<<AIN1D) | (1<<AIN0D);
// comparing AIN1 (Vcc/4.4) to bandgap reference (1.1V)
// bandgap select | AC interrupt enable | AC interrupt on rising edge (DS p.243)
ACSR |= (1<<ACBG) | (1<<ACIE) | (1<<ACIS1) | (1<<ACIS0);
}
int main(void)
{
// RS-485: Configure PD5=DE as output pin with low as default
DDRD |= (1<<DDD5);
// set high to transmit
//PORTD |= (1<<PD5);
setup_timer1();
setup_pulse_input();
setup_analog_comparator();
// initialize the CTRL buffers
ctrlInit();
// initialize the UART hardware and buffers
uartInit();
// initialize the SPI in slave mode
setup_spi(SPI_MODE_0, SPI_MSB, SPI_INTERRUPT, SPI_SLAVE);
for(;;) {
if (spi_status & NEW_CTRL_MSG) {
ctrlRxToTxLoop();
spi_status &= ~NEW_CTRL_MSG;
}
// toggle the LED=PB0 pin
_delay_ms(50);
DDRB ^= (1<<PB0);
}
return 0;
}

View File

@ -1,153 +0,0 @@
//
// buffer.c : Multipurpose byte buffer structure and methods
//
// Copyright (c) 2001 Pascal Stang
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#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;
}

View File

@ -1,73 +0,0 @@
//
// buffer.h : Multipurpose byte buffer structure and methods
//
// 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.
//
// Copyright (c) 2001-2002 Pascal Stang
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#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

View File

@ -1,468 +0,0 @@
//
// ctrl.c : AVR uC code for ctrl buffer initialisation and put/get ops
//
// Copyright (c) 2010 flukso.net
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#include <avr/eeprom.h>
#include <util/crc16.h>
#include "global.h"
#include "main.h"
#include "buffer.h"
#include "ctrl.h"
#include "encode.h"
cBuffer ctrlRxBuffer; // ctrl receive buffer
cBuffer ctrlTxBuffer; // ctrl transmit buffer
static char ctrlRxData[CTRL_RX_BUFFER_SIZE];
static char ctrlTxData[CTRL_TX_BUFFER_SIZE];
extern struct version_struct EEMEM EEPROM_version;
extern struct version_struct version;
extern struct event_struct EEMEM EEPROM_event;
extern struct event_struct event;
extern uint8_t EEMEM EEPROM_enabled;
extern uint8_t enabled;
extern uint8_t EEMEM EEPROM_phy_to_log[MAX_SENSORS];
extern uint8_t phy_to_log[MAX_SENSORS];
extern struct sensor_struct EEMEM EEPROM_sensor[MAX_SENSORS];
extern struct sensor_struct sensor[MAX_SENSORS];
extern struct state_struct state[MAX_SENSORS];
void ctrlInit(void)
{
// initialize the CTRL receive buffer
bufferInit(&ctrlRxBuffer, (u08*) ctrlRxData, CTRL_RX_BUFFER_SIZE);
// initialize the CTRL transmit buffer
bufferInit(&ctrlTxBuffer, (u08*) ctrlTxData, CTRL_TX_BUFFER_SIZE);
}
uint8_t ctrlTxBufferIsEmpty(void)
{
if(ctrlTxBuffer.datalength == 0) {
return TRUE;
}
else {
return FALSE;
}
}
uint8_t ctrlAddToTxBuffer(uint8_t data)
{
return bufferAddToEnd(&ctrlTxBuffer, data);
}
uint8_t ctrlGetFromTxBuffer(uint8_t* data) {
// make sure we have data in the Tx buffer
if(ctrlTxBuffer.datalength) {
// get byte from beginning of buffer
*data = bufferGetFromFront(&ctrlTxBuffer);
return TRUE;
}
else {
// no data
return FALSE;
}
}
uint8_t ctrlRxBufferIsEmpty(void)
{
if(ctrlRxBuffer.datalength == 0) {
return TRUE;
}
else {
return FALSE;
}
}
uint8_t ctrlAddToRxBuffer(uint8_t data)
{
return bufferAddToEnd(&ctrlRxBuffer, data);
}
uint8_t ctrlGetFromRxBuffer(uint8_t* pdata)
{
// make sure we have data in the Rx buffer
if(ctrlRxBuffer.datalength) {
// get byte from beginning of buffer
*pdata = bufferGetFromFront(&ctrlRxBuffer);
return TRUE;
}
else {
// no data
return FALSE;
}
}
void ctrlFlushRxBuffer(void)
{
ctrlRxBuffer.datalength = 0;
}
void ctrlFlushTxBuffer(void)
{
ctrlTxBuffer.datalength = 0;
}
uint8_t ctrlReadCharFromRxBuffer(uint8_t* pdata)
{
uint8_t high_hex, low_hex;
if (ctrlGetFromRxBuffer(&high_hex) && ctrlGetFromRxBuffer(&low_hex)) {
htob(high_hex, low_hex, pdata);
return TRUE;
}
else {
return FALSE;
}
}
uint8_t ctrlReadShortFromRxBuffer(uint16_t* pdata)
{
uint8_t high_char, low_char;
if(ctrlReadCharFromRxBuffer(&high_char) && ctrlReadCharFromRxBuffer(&low_char)) {
*pdata = ((uint16_t)high_char << 8) + low_char;
return TRUE;
}
else {
return FALSE;
}
}
uint8_t ctrlReadLongFromRxBuffer(uint32_t* pdata)
{
uint16_t high_short, low_short;
if(ctrlReadShortFromRxBuffer(&high_short) && ctrlReadShortFromRxBuffer(&low_short)) {
*pdata = ((uint32_t)high_short << 16) + low_short;
return TRUE;
}
else {
return FALSE;
}
}
uint8_t ctrlWriteCharToTxBuffer(uint8_t data)
{
uint8_t high_hex, low_hex;
btoh(data, &high_hex, &low_hex);
if (ctrlAddToTxBuffer(high_hex) && ctrlAddToTxBuffer(low_hex)) {
return TRUE;
}
else {
return FALSE;
}
}
uint8_t ctrlWriteShortToTxBuffer(uint16_t data)
{
if (ctrlWriteCharToTxBuffer((uint8_t)(data >> 8)) && ctrlWriteCharToTxBuffer((uint8_t)data)) {
return TRUE;
}
else {
return FALSE;
}
}
uint8_t ctrlWriteLongToTxBuffer(uint32_t data)
{
if (ctrlWriteShortToTxBuffer((uint16_t)(data >> 16)) && ctrlWriteShortToTxBuffer((uint16_t)data)) {
return TRUE;
}
else {
return FALSE;
}
}
void ctrlRxToTxLoop(void)
{
uint8_t data;
while (ctrlGetFromRxBuffer(&data)) {
ctrlAddToTxBuffer(data);
}
}
uint8_t ctrlCalcCrc8(cBuffer* buffer, uint8_t chop)
{
uint8_t i, crc = 0;
for (i = 0; i < buffer->datalength - chop; i++) {
crc = _crc_ibutton_update(crc, bufferGetAtIndex(buffer, i));
}
return crc;
}
uint8_t ctrlExtractCrc8fromMessage(cBuffer* buffer)
{
uint8_t crc, high_hex, low_hex;
high_hex = bufferGetAtIndex(buffer, buffer->datalength - 2);
low_hex = bufferGetAtIndex(buffer, buffer->datalength - 1);
htob(high_hex, low_hex, &crc);
return crc;
}
void ctrlDecode(void)
{
uint8_t cmd[2], crc;
ctrlFlushTxBuffer();
crc = ctrlExtractCrc8fromMessage(&ctrlRxBuffer);
if (ctrlCalcCrc8(&ctrlRxBuffer, 2) != crc) {
ctrlAddToTxBuffer('z');
ctrlAddToTxBuffer('z');
}
else if (ctrlGetFromRxBuffer(cmd) && ctrlGetFromRxBuffer(cmd+1)) {
ctrlAddToTxBuffer(cmd[0]);
ctrlAddToTxBuffer(cmd[1]);
switch (cmd[0]) {
case 'g': /* get */
ctrlCmdGet(cmd[1]);
break;
case 's': /* set */
ctrlCmdSet(cmd[1]);
break;
case 'c': /* commit */
if (cmd[1] == 't') ctrlCmdCommit();
break;
}
}
else {
ctrlAddToTxBuffer('z');
ctrlAddToTxBuffer('y');
}
crc = ctrlCalcCrc8(&ctrlTxBuffer, 0);
ctrlWriteCharToTxBuffer(crc);
ctrlAddToTxBuffer('.');
ctrlFlushRxBuffer();
}
void ctrlCmdGet(uint8_t cmd)
{
uint8_t i = 0;
uint32_t tmp32, tmp32_bis;
switch (cmd) {
case 'h': /* hardware {major,minor} version */
ctrlWriteShortToTxBuffer(version.hw_major);
ctrlWriteCharToTxBuffer(version.hw_minor);
break;
case 's': /* software {major,minor} version */
ctrlWriteCharToTxBuffer(version.sw_major);
ctrlWriteCharToTxBuffer(version.sw_minor);
break;
case 'e': /* sensor enabled | disabled */
ctrlReadCharFromRxBuffer(&i);
if (i < MAX_SENSORS) {
ctrlWriteCharToTxBuffer(i);
ctrlWriteCharToTxBuffer((enabled >> i) & 0x01);
}
break;
case 'p': /* phy-to-logical mapping */
for (i = 0 ; i < MAX_SENSORS; i++) {
ctrlWriteCharToTxBuffer(phy_to_log[i]);
}
break;
case 'c': /* sensor counter value */
ctrlReadCharFromRxBuffer(&i);
if (i < MAX_SENSORS) {
cli();
tmp32 = sensor[i].counter;
sei();
ctrlWriteCharToTxBuffer(i);
ctrlWriteLongToTxBuffer(tmp32);
}
break;
case 'm': /* sensor meterconstant */
ctrlReadCharFromRxBuffer(&i);
if (i < MAX_SENSORS) {
ctrlWriteCharToTxBuffer(i);
ctrlWriteShortToTxBuffer(sensor[i].meterconst);
}
break;
case 'w': /* watchdog counter */
ctrlWriteShortToTxBuffer(event.wdt);
break;
case 'b': /* brown-out counter */
ctrlWriteShortToTxBuffer(event.brown_out);
break;
case 'd': /* delta: all changes since last gd */
for (i = 0 ; i < MAX_SENSORS; i++) {
if (state[i].flags & (STATE_PULSE | STATE_POWER)) {
ctrlWriteCharToTxBuffer(i);
cli();
tmp32 = sensor[i].counter;
tmp32_bis = (i < MAX_ANALOG_SENSORS) ? state[i].power : state[i].timestamp;
state[i].flags &= ~(STATE_PULSE | STATE_POWER);
sei();
ctrlWriteLongToTxBuffer(tmp32);
ctrlWriteLongToTxBuffer(tmp32_bis);
}
}
break;
}
}
void ctrlCmdSet(uint8_t cmd)
{
uint8_t i = 0, tmp8 = 0;
uint16_t tmp16 = 0;
uint32_t tmp32 = 0;
switch (cmd) {
case 'h': /* hardware {major,minor} version */
ctrlReadShortFromRxBuffer(&version.hw_major);
ctrlReadCharFromRxBuffer(&version.hw_minor);
ctrlWriteShortToTxBuffer(version.hw_major);
ctrlWriteCharToTxBuffer(version.hw_minor);
break;
case 's': /* software {major,minor} version */
ctrlReadCharFromRxBuffer(&version.sw_major);
ctrlReadCharFromRxBuffer(&version.sw_minor);
ctrlWriteCharToTxBuffer(version.sw_major);
ctrlWriteCharToTxBuffer(version.sw_minor);
break;
case 'e': /* sensor enabled | disabled */
ctrlReadCharFromRxBuffer(&i);
if (i < MAX_SENSORS) {
ctrlReadCharFromRxBuffer(&tmp8);
if (tmp8) {
enabled |= (1 << i);
}
else {
enabled &= ~(1 << i);
}
ctrlWriteCharToTxBuffer(i);
ctrlWriteCharToTxBuffer((enabled >> i) & 0x01);
}
break;
case 'p': /* phy-to-logical mapping */
for (i = 0 ; i < MAX_SENSORS; i++) {
ctrlReadCharFromRxBuffer(&tmp8);
cli();
phy_to_log[i] = tmp8;
sei();
ctrlWriteCharToTxBuffer(phy_to_log[i]);
}
break;
case 'c': /* sensor counter value */
ctrlReadCharFromRxBuffer(&i);
if (i < MAX_SENSORS) {
ctrlReadLongFromRxBuffer(&tmp32);
cli();
sensor[i].counter = tmp32;
sei();
ctrlWriteCharToTxBuffer(i);
ctrlWriteLongToTxBuffer(tmp32);
}
break;
case 'm': /* sensor meterconstant */
ctrlReadCharFromRxBuffer(&i);
if (i < MAX_SENSORS) {
ctrlReadShortFromRxBuffer(&tmp16);
cli();
sensor[i].meterconst = tmp16;
sei();
ctrlWriteCharToTxBuffer(i);
ctrlWriteShortToTxBuffer(sensor[i].meterconst);
}
break;
case 'w': /* watchdog counter */
ctrlReadShortFromRxBuffer(&tmp16);
cli();
event.wdt = tmp16;
sei();
ctrlWriteShortToTxBuffer(event.wdt);
break;
case 'b': /* brown-out counter */
ctrlReadShortFromRxBuffer(&tmp16);
cli();
event.brown_out = tmp16;
sei();
ctrlWriteShortToTxBuffer(event.brown_out);
break;
}
}
void ctrlCmdCommit(void)
{
cli();
eeprom_update_block((const void*)&version, (void*)&EEPROM_version, sizeof(version));
eeprom_update_block((const void*)&event, (void*)&EEPROM_event, sizeof(event));
eeprom_update_block((const void*)&enabled, (void*)&EEPROM_enabled, sizeof(enabled));
eeprom_update_block((const void*)&phy_to_log, (void*)&EEPROM_phy_to_log, sizeof(phy_to_log));
eeprom_update_block((const void*)&sensor, (void*)&EEPROM_sensor, sizeof(sensor));
sei();
}

View File

@ -1,153 +0,0 @@
//
// ctrl.h : AVR uC code for ctrl buffer initialisation and put/get ops
//
// Copyright (c) 2010 flukso.net
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#ifndef CTRL_H
#define CTRL_H
#endif
#include <inttypes.h>
#include "buffer.h"
#ifndef CTRL_RX_BUFFER_SIZE
#define CTRL_RX_BUFFER_SIZE 32
#endif
#ifndef CTRL_TX_BUFFER_SIZE
#define CTRL_TX_BUFFER_SIZE 32
#endif
/**
* Initialize the ctrl receive and transmit buffers.
*
* Overrule the default Rx and Tx ctrl buffer size (32 bytes) in the makefile.
*/
void ctrlInit(void);
/**
* Check whether the ctrl Tx buffer is empty.
*
* @return TRUE/FALSE if empty/not empty
*/
uint8_t ctrlTxBufferIsEmpty(void);
/**
* Add a byte to the ctrl Tx buffer's tail.
*
* @param data the byte to be added to the buffer's tail
* @return TRUE/FALSE if byte could/could not be written
*/
uint8_t ctrlAddToTxBuffer(uint8_t data);
/**
* Fetch a byte from the ctrl Tx buffer's head.
*
* @param data pointer where the byte has to be written
* @return TRUE/FALSE if a byte could be fetched/not fetched
*/
uint8_t ctrlGetFromTxBuffer(uint8_t* data);
/**
* Check whether the ctrl Rx buffer is empty.
*
* @return TRUE/FALSE if empty/not empty
*/
uint8_t ctrlRxBufferIsEmpty(void);
/**
* Add a byte to the ctrl Rx buffer.
*
* @param data the byte to be added to the buffer's tail
* @return TRUE/FALSE if empty/not empty
*/
uint8_t ctrlAddToRxBuffer(uint8_t data);
/**
* Fetch a byte from the ctrl Rx buffer's head.
*
* @param data pointer where the byte has to be written
* @return TRUE/FALSE if a byte could be fetched/not fetched
*/
uint8_t ctrlGetFromRxBuffer(uint8_t* data);
/**
* Flush the ctrl Rx buffer.
*
*/
void ctrlFlushRxBuffer(void);
/**
* Flush the ctrl Tx buffer.
*
*/
void ctrlFlushTxBuffer(void);
/**
* Loop all bytes from the ctrl Rx to Tx buffer.
*
*/
void ctrlRxToTxLoop(void);
/**
* Calculate the CRC-8 checksum over the bytes in the buffer.
*
* @param buffer pointer to the buffer containing the data
* @param chop chop number of bytes from end of buffer for crc calc
* @return CRC-8 checksum
*/
uint8_t ctrlCalcCrc8(cBuffer* buffer, uint8_t chop);
/**
* Extract the CRC-8 checksum out of the message in the buffer.
*
* @param buffer pointer to the buffer containing the message
* @return CRC-8 checksum
*/
uint8_t ctrlExtractCrc8fromMessage(cBuffer* buffer);
/**
* Decode the message in the ctrl Rx buffer and dispatch to either ctrlCmdGet,
* ctrlCmdSet or ctrlCmdCommit.
*
*/
void ctrlDecode(void);
/**
* Execute the get command with parameters present in the ctrl Rx buffer.
* The command's reply is written to the ctrl Tx buffer.
*
* @param cmd get command issued
*/
void ctrlCmdGet(uint8_t cmd);
/**
* Execute the set command with parameters present in the ctrl Rx buffer.
* The command's reply is written to the ctrl Tx buffer. In case of a set
* command this will typically only be the two-letter command ID issued.
*
* @param cmd set command issued
*/
void ctrlCmdSet(uint8_t cmd);
/**
* Commit all previous changes by writing the datastructures to EEPROM.
*
*/
void ctrlCmdCommit(void);

View File

@ -1,20 +0,0 @@
#if DBG > 0
/* set LED pin high/low at the start/end of an ISR */
#define DBG_ISR_BEGIN() PORTB |= (1<<PB0)
#define DBG_ISR_END() PORTB &= ~(1<<PB0)
/* Set PB1=OC1A as output pin and toggle this pin on TIMER1 compare match */
#define DBG_OC1A_TOGGLE() DDRB |= (1<<DDB1); \
TCCR1A |= 1<<COM1A0
#define DBG_LED_ON() /* nothing */
#define DBG_LED_OFF() /* nothing */
#else
#define DBG_ISR_BEGIN() /* nothing */
#define DBG_ISR_END() /* nothing */
#define DBG_OC1A_TOGGLE() /* nothing */
/* LED behaviour in non-debugging mode */
#define DBG_LED_ON() PORTB &= ~(1<<PB0)
#define DBG_LED_OFF() PORTB |= (1<<PB0)
#endif

View File

@ -1,18 +0,0 @@
#include <stdint.h>
// hex to binary/byte decoding
static inline void htob(uint8_t high_hex, uint8_t low_hex, uint8_t *pbyte)
{
*pbyte = (high_hex > 0x40) ? (high_hex & 0x0F) + 9 : high_hex & 0x0F;
*pbyte = *pbyte << 4;
*pbyte |= (low_hex > 0x40) ? (low_hex & 0x0F) + 9 : low_hex & 0x0F;
}
// binary/byte to hex encoding
static inline void btoh(uint8_t byte, uint8_t *phigh_hex, uint8_t *plow_hex)
{
*plow_hex = byte & 0x0F;
*plow_hex = (*plow_hex > 0x09) ? *plow_hex - 9 + 0x60 : *plow_hex + 0x30;
*phigh_hex = (byte & 0xF0) >> 4;
*phigh_hex = (*phigh_hex > 0x09) ? *phigh_hex - 9 + 0x60 : *phigh_hex + 0x30;
}

View File

@ -1,54 +0,0 @@
//
// global.h : AVR project global include
//
// Copyright (c) 2001-2002 Pascal Stang
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#ifndef GLOBAL_H
#define GLOBAL_H
// global AVRLIB defines
#include "avrlibdefs.h"
// global AVRLIB types definitions
#include "avrlibtypes.h"
// project/system dependent defines
// 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
#define DISABLE_PORT 0xff
#define MAX_SENSORS 6
#define MAX_ANALOG_SENSORS 3
#define ENABLE_ALL_SENSORS ((1 << MAX_SENSORS) - 1)
#define DISABLE_ALL_SENSORS 0x00
/* 0xff is the default sensor id for non-assigned ports and is disabled by default
a further check is done against the 'enabled' bitfield */
#define ENABLED(x) (x != 0xff) && (enabled & (1 << x))
#endif

View File

@ -1,433 +0,0 @@
//
// basiciotest.c : test code for the io and buffer ops of the UART and SPI ports
//
// Copyright (c) 2010 flukso.net
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#include <stdlib.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include <avr/power.h>
#include <util/delay.h>
#include "debug.h"
#include "main.h"
#include "uart.h"
#include "spi.h"
#include "ctrl.h"
#include "global.h"
#include "encode.h"
register uint8_t spi_status asm("r7");
uint8_t spi_high_hex;
uint8_t EEMEM first_EEPROM_byte_not_used_to_protect_from_brownout_corruption = 0xbe;
struct version_struct EEMEM EEPROM_version =
{HW_VERSION_MAJOR, HW_VERSION_MINOR, SW_VERSION_MAJOR, SW_VERSION_MINOR};
struct version_struct version;
struct event_struct EEMEM EEPROM_event = {0, 0};
struct event_struct event;
uint8_t EEMEM EEPROM_enabled = DISABLE_ALL_SENSORS;
uint8_t enabled;
uint8_t EEMEM EEPROM_phy_to_log[MAX_SENSORS] =
{DISABLE_PORT, DISABLE_PORT, DISABLE_PORT, DISABLE_PORT, DISABLE_PORT, DISABLE_PORT};
uint8_t phy_to_log[MAX_SENSORS];
struct sensor_struct EEMEM EEPROM_sensor[MAX_SENSORS];
volatile struct sensor_struct sensor[MAX_SENSORS];
volatile struct state_struct state[MAX_SENSORS];
uint8_t muxn = 0;
uint16_t timer = 0;
struct time_struct time = {0, 0};
ISR(SPI_STC_vect)
{
uint8_t spi_rx, spi_tx, rx, tx;
DBG_ISR_BEGIN();
// the SPI is double-buffered, requiring two NO_OPs when switching from Tx to Rx
if (spi_status & (SPI_NO_OP_1 | SPI_NO_OP_2)) {
spi_status--;
DBG_LED_ON();
goto finish;
}
// do we have to transmit the first byte?
if (spi_status & SPI_START_TX) {
received_from_spi(SPI_FORWARD_TO_CTRL_PORT);
spi_status &= ~SPI_START_TX;
goto finish;
}
// are we in Tx mode?
if (spi_status & SPI_TRANSMIT) {
if (spi_status & SPI_HIGH_HEX) {
received_from_spi(spi_high_hex); /* actually low hex ! */
spi_status &= ~SPI_HIGH_HEX;
goto finish;
}
if (spi_status & SPI_TO_FROM_UART) {
if (!uartReceiveByte(&tx)) {
received_from_spi(SPI_END_OF_TX);
spi_status &= ~SPI_TRANSMIT;
spi_status |= SPI_NO_OP_2;
goto finish;
}
}
else {
if (ctrlGetFromTxBuffer(&tx)) {
received_from_spi(tx);
goto finish;
}
else {
received_from_spi(SPI_FORWARD_TO_UART_PORT);
spi_status |= SPI_TO_FROM_UART;
goto finish;
}
}
btoh(tx, &spi_tx, (uint8_t *)&spi_high_hex); /* actually low hex ! */
spi_status |= SPI_HIGH_HEX;
received_from_spi(spi_tx);
goto finish;
}
// we're in Rx mode
switch (spi_rx = received_from_spi(0x00)) {
case SPI_END_OF_TX:
spi_status |= SPI_TRANSMIT | SPI_START_TX;
spi_status &= ~(SPI_HIGH_HEX | SPI_TO_FROM_UART);
break;
case SPI_END_OF_MESSAGE:
if (!(spi_status & SPI_TO_FROM_UART)) {
spi_status |= SPI_NEW_CTRL_MSG;
}
break;
case SPI_FORWARD_TO_UART_PORT:
spi_status |= SPI_TO_FROM_UART;
DBG_LED_OFF();
break;
case SPI_FORWARD_TO_CTRL_PORT:
spi_status &= ~SPI_TO_FROM_UART;
DBG_LED_OFF();
break;
default:
if (spi_status & SPI_HIGH_HEX) {
htob(spi_high_hex, spi_rx, &rx);
uartAddToTxBuffer(rx);
}
else {
if (spi_status & SPI_TO_FROM_UART) {
spi_high_hex = spi_rx;
}
else {
ctrlAddToRxBuffer(spi_rx);
goto finish;
}
}
// toggle the HEX bit in spi_status
spi_status ^= SPI_HIGH_HEX;
}
finish:
DBG_ISR_END();
}
ISR(INT0_vect)
{
DBG_ISR_BEGIN();
uint8_t sensor_id = phy_to_log[PORT_PULSE_1];
if (ENABLED(sensor_id))
register_pulse(&sensor[sensor_id], &state[sensor_id]);
DBG_ISR_END();
}
ISR(INT1_vect)
{
DBG_ISR_BEGIN();
uint8_t sensor_id = phy_to_log[PORT_PULSE_2];
if (ENABLED(sensor_id))
register_pulse(&sensor[sensor_id], &state[sensor_id]);
DBG_ISR_END();
}
void register_pulse(volatile struct sensor_struct *psensor, volatile struct state_struct *pstate)
{
psensor->counter += psensor->meterconst;
pstate->flags |= STATE_PULSE;
pstate->timestamp = time.ms;
}
ISR(TIMER1_COMPA_vect)
{
DBG_ISR_BEGIN();
uint8_t sensor_id = phy_to_log[muxn];
if (ENABLED(sensor_id)) {
/* clear the power calculation lock when starting a new 1sec cycle */
if (timer == 0)
state[sensor_id].flags &= ~STATE_POWER_LOCK;
MacU16X16to32(state[sensor_id].nano, sensor[sensor_id].meterconst, ADC);
if (state[sensor_id].nano > WATT) {
sensor[sensor_id].counter++;
state[sensor_id].flags |= STATE_PULSE;
state[sensor_id].nano -= WATT;
state[sensor_id].pulse_count++;
}
if ((timer == SECOND) && !(state[sensor_id].flags & STATE_POWER_LOCK)) {
state[sensor_id].nano_start = state[sensor_id].nano_end;
state[sensor_id].nano_end = state[sensor_id].nano;
state[sensor_id].pulse_count_final = state[sensor_id].pulse_count;
state[sensor_id].pulse_count = 0;
state[sensor_id].flags |= STATE_POWER_CALC | STATE_POWER_LOCK;
}
}
/* Cycle through the available ADC input channels (0/1/2). */
muxn++;
if (!(muxn %= 3)) timer++;
if (timer > SECOND) timer = 0;
/* In order to map this to 1000Hz (=ms) we have to skip every second interrupt. */
if (!time.skip) time.ms++ ;
time.skip ^= 1;
ADMUX &= 0xF8;
ADMUX |= muxn;
/* Start a new ADC conversion. */
ADCSRA |= (1<<ADSC);
DBG_ISR_END();
}
ISR(TIMER1_CAPT_vect)
{
disable_led();
// throttle the cpu clock to draw less amps
// raises the number of bytes that can be written to EEPROM from 43 to 48
clock_prescale_set(clock_div_16);
event.brown_out++;
#if DBG > 0
uint8_t i;
for (i=0; i<128; i++)
eeprom_write_byte((uint8_t *)(i + 0x0100), i);
#else
eeprom_update_block((const void*)&sensor, (void*)&EEPROM_sensor, sizeof(sensor));
eeprom_update_block((const void*)&event, (void*)&EEPROM_event, sizeof(event));
#endif
// restore the original clock setting
clock_prescale_set(clock_div_1);
setup_led();
}
void setup_datastructs(void)
{
cli();
eeprom_read_block((void*)&version, (const void*)&EEPROM_version, sizeof(version));
eeprom_read_block((void*)&event, (const void*)&EEPROM_event, sizeof(event));
eeprom_read_block((void*)&enabled, (const void*)&EEPROM_enabled, sizeof(enabled));
eeprom_read_block((void*)&phy_to_log, (const void*)&EEPROM_phy_to_log, sizeof(phy_to_log));
eeprom_read_block((void*)&sensor, (const void*)&EEPROM_sensor, sizeof(sensor));
sei();
}
void setup_led(void)
{
// set output low (= LED enabled)
PORTB &= ~(1<<PB0);
// set LED pin (PB0) as output pin
DDRB |= (1<<DDB0);
}
void disable_led(void)
{
// set LED pin (PB0) as input pin
DDRB &= ~(1<<DDB0);
// disable pull-up
PORTB &= ~(1<<PB0);
}
void setup_pulse_input(void)
{
// PD2=INT0 and PD3=INT1 configuration
// set as input pin with 20k pull-up enabled
PORTD |= (1<<PD2) | (1<<PD3);
// INT0 and INT1 to trigger an interrupt on a falling edge
EICRA = (1<<ISC01) | (1<<ISC11);
// enable INT0 and INT1 interrupts
EIMSK = (1<<INT0) | (1<<INT1);
}
void setup_adc(void)
{
// disable digital input cicuitry on ADCx pins to reduce leakage current
DIDR0 |= (1<<ADC5D) | (1<<ADC4D) | (1<<ADC3D) | (1<<ADC2D) | (1<<ADC1D) | (1<<ADC0D);
// select VBG as reference for ADC
ADMUX |= (1<<REFS1) | (1<<REFS0);
// ADC prescaler set to 32 => 3686.4kHz / 32 = 115.2kHz (DS p.258)
ADCSRA |= (1<<ADPS2) | (1<<ADPS0);
// enable ADC and start a first ADC conversion
ADCSRA |= (1<<ADEN) | (1<<ADSC);
}
void setup_timer1(void)
{
// Timer1 clock prescaler set to 1 => fTOV1 = 3686.4kHz / 65536 = 56.25Hz (DS p.134)
TCCR1B |= (1<<CS10);
// Increase sampling frequency to 2kHz (= 667Hz per channel) with an error of 0.01% (DS p.122)
OCR1A = 0x0732;
// Timer1 set to CTC mode (DS p.133)
TCCR1B |= 1<<WGM12;
// Enable output compare match interrupt for timer1 (DS p.136)
TIMSK1 |= (1<<OCIE1A);
// Activate the input capture noise canceler and trigger the IC on a positive edge (DS p.133)
TCCR1B |= (1<<ICNC1) | (1<<ICES1);
// Enable input capture interrupt (DS p.136)
TIMSK1 |= (1<<ICIE1);
DBG_OC1A_TOGGLE();
}
void setup_analog_comparator(void)
{
// analog comparator setup for brown-out detection
// PD7=AIN1 configured by default as input to obtain high impedance
// disable digital input cicuitry on AIN0 and AIN1 pins to reduce leakage current
DIDR1 |= (1<<AIN1D) | (1<<AIN0D);
// comparing AIN1 (Vcc/4.4) to bandgap reference (1.1V)
// select bandgap reference and enable input capture function in timer1 (DS p.244 & 116)
ACSR |= (1<<ACBG) | (1<<ACIC);
}
void calculate_power(volatile struct state_struct *pstate)
{
int32_t rest, power = 0;
uint8_t pulse_count;
cli();
rest = pstate->nano_end - pstate->nano_start;
pulse_count = pstate->pulse_count_final;
sei();
// Since the AVR has no dedicated floating-point hardware, we need
// to resort to fixed-point calculations for converting nWh/s to W.
// 1W = 10^6/3.6 nWh/s
// power[watt] = 3.6/10^6 * rest[nWh/s]
// power[watt] = 3.6/10^6 * 65536 * (rest[nWh/s] / 65536)
// power[watt] = 3.6/10^6 * 65536 * 262144 / 262144 * (rest[nWh/s] / 65536)
// power[watt] = 61847.53 / 262144 * (rest[nWh/s] / 65536)
// We have to correct for only using 666 samples iso 2000/3, so:
// power[watt] = 61847.53 * 1/666 * 2000/3 / 262144 * (rest[nWh/s] / 65536)
// power[watt] = 61909.44 / 262144 * (rest[nWh/s] / 65536)
// We round the constant down to 61909 to prevent 'underflow' in the
// consecutive else statement.
// The error introduced in the fixed-point rounding equals 7.1*10^-6.
MacU16X16to32(power, (uint16_t)(labs(rest)/65536), 61909);
power /= 262144;
if (rest >= 0) {
power += pulse_count*3600;
}
else {
power = pulse_count*3600 - power;
}
pstate->power = power;
}
int main(void)
{
uint8_t i;
cli();
// RS-485: Configure PD5=DE as output pin with low as default
DDRD |= (1<<DDD5);
// set high to transmit
//PORTD |= (1<<PD5);
setup_datastructs();
setup_led();
setup_adc();
setup_pulse_input();
setup_analog_comparator();
setup_timer1();
// initialize the CTRL buffers
ctrlInit();
// initialize the UART hardware and buffers
uartInit();
// initialize the SPI in slave mode
setup_spi(SPI_MODE_2, SPI_MSB, SPI_INTERRUPT, SPI_SLAVE);
sei();
for(;;) {
if (spi_status & SPI_NEW_CTRL_MSG) {
ctrlDecode();
spi_status &= ~SPI_NEW_CTRL_MSG;
}
for (i = 0; i < MAX_ANALOG_SENSORS; i++) {
if (state[i].flags & STATE_POWER_CALC) {
calculate_power(&state[i]);
state[i].flags &= ~STATE_POWER_CALC;
state[i].flags |= STATE_POWER;
}
}
}
return 0;
}

View File

@ -1,101 +0,0 @@
struct version_struct {
uint16_t hw_major;
uint8_t hw_minor;
uint8_t sw_major;
uint8_t sw_minor;
};
#define PORT_PULSE_1 3
#define PORT_PULSE_2 4
#define SPI_NO_OP_1 0x01
#define SPI_NO_OP_2 0x02
#define SPI_START_TX 0x04
#define SPI_TRANSMIT 0x08
#define SPI_HIGH_HEX 0x10
#define SPI_TO_FROM_UART 0x20
#define SPI_NEW_CTRL_MSG 0x40
#define SPI_END_OF_TX 0x00
#define SPI_END_OF_MESSAGE '.'
#define SPI_FORWARD_TO_UART_PORT 'u'
#define SPI_FORWARD_TO_CTRL_PORT 'l' // 'l'ocal port
struct event_struct {
uint16_t wdt;
uint16_t brown_out;
};
struct sensor_struct {
uint32_t counter;
uint16_t meterconst;
};
# define WATT 1000000000
# define SECOND 665 // 666Hz - 1
#define STATE_PULSE 0x01
#define STATE_SKIP 0x02
#define STATE_POWER_LOCK 0x04
#define STATE_POWER_CALC 0x08
#define STATE_POWER 0x10
struct state_struct {
uint8_t flags;
uint32_t nano;
uint32_t nano_start;
uint32_t nano_end;
uint8_t pulse_count;
uint8_t pulse_count_final;
uint32_t power;
uint32_t timestamp;
};
struct time_struct {
uint8_t skip;
uint32_t ms;
};
/*
* This macro performs a 16x16 -> 32 unsigned MAC in 37 cycles with operands and results in memory
* based on http://www2.ife.ee.ethz.ch/~roggend/publications/wear/DSPMic_v1.1.pdf par 3.4 and table 31.
*/
#define MacU16X16to32(uint_32Acc, uint_16In1, uint_16In2) \
asm volatile ( \
"clr r2 \n\t" \
"mul %B2, %B1 \n\t" \
"movw r4, r0 \n\t" \
"mul %A2, %A1 \n\t" \
"add %A0, r0 \n\t" \
"adc %B0, r1 \n\t" \
"adc %C0, r4 \n\t" \
"adc %D0, r5 \n\t" \
"mul %B2, %A1 \n\t" \
"add %B0, r0 \n\t" \
"adc %C0, r1 \n\t" \
"adc %D0, r2 \n\t" \
"mul %A2, %B1 \n\t" \
"add %B0, r0 \n\t" \
"adc %C0, r1 \n\t" \
"adc %D0, r2 \n\t" \
"clr r1 \n\t" \
: \
"+r" (uint_32Acc) \
: \
"a" (uint_16In1), \
"a" (uint_16In2) \
: \
"r2", "r4", "r5" \
)
void register_pulse(volatile struct sensor_struct *psensor, volatile struct state_struct *pstate);
void setup_led(void);
void disable_led(void);
void setup_datastructs(void);
void setup_pulse_input(void);
void setup_adc(void);
void setup_timer1(void);
void setup_analog_comparator(void);
void calculate_power(volatile struct state_struct *pstate);

View File

@ -1,568 +0,0 @@
#
# makefile
#
# Copyright (c) Eric B. Weddington, Jörg Wunsch, et al.
# Peter Fleury
# Bart Van Der Meerssche
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# $Id$
#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device, using avrdude.
# Please customize the avrdude settings below first!
#
# make rprogram = Upload the hex and eep file to the Fluksometer's /tmp.
# Then flash the fuses, hex and eep through the onboard avrdude.
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------
# Sensor board versioning:
HW_VERSION_MAJOR = 2
HW_VERSION_MINOR = 0
SW_VERSION_MAJOR = 1
SW_VERSION_MINOR = 0
# MCU name
MCU = atmega168
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
F_CPU = 3686400
# Output format. (can be srec, ihex, binary)
FORMAT = ihex
# Target file name (without extension).
TARGET = main
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c buffer.c uart.c spi.c ctrl.c
# List Assembler source files here.
# Make them always end in a capital .S. Files ending in a lowercase .s
# will not be considered source files but generated files (assembler
# output from the compiler), and will be deleted upon "make clean"!
# Even though the DOS/Win* filesystem matches both .s and .S the same,
# it will preserve the spelling of the filenames, and gcc itself does
# care about how the name is spelled on its command-line.
ASRC =
# Optimization level, can be [0, 1, 2, 3, s].
# 0 = turn off optimization. s = optimize for size.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
# Debugging format.
# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
# AVR Studio 4.10 requires dwarf-2.
# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
DEBUG = dwarf-2
# List any extra directories to look for include files here.
# Each directory must be seperated by a space.
# Use forward slashes for directory separators.
# For a directory that has spaces, enclose it in quotes.
EXTRAINCDIRS =
# Compiler flag to set the C Standard level.
# c89 = "ANSI" C
# gnu89 = c89 plus GCC extensions
# c99 = ISO C99 standard (not yet fully implemented)
# gnu99 = c99 plus GCC extensions
CSTANDARD = -std=gnu99
# Place -D or -U options here
CDEFS = -DF_CPU=$(F_CPU)UL
# Debugging mode
DBG = 0
CDEFS += -D DBG=$(DBG)
# Warn when a function marked for inlining could not be substituted
CDEFS += -Winline
# Inline all 'simple-enough' functions (seems to be done by default in -Os)
CDEFS += -finline-functions
# Sensor board ID
CDEFS += -DBOARD_ID=$(BOARD_ID)
# Sensor board hw/sw major/minor version
CDEFS += -DHW_VERSION_MAJOR=$(HW_VERSION_MAJOR) -DHW_VERSION_MINOR=$(HW_VERSION_MINOR)
CDEFS += -DSW_VERSION_MAJOR=$(SW_VERSION_MAJOR) -DSW_VERSION_MINOR=$(SW_VERSION_MINOR)
# uncomment and adapt these line if you want different UART library buffer size
CDEFS += -DUART_RX_BUFFER_SIZE=256
CDEFS += -DUART_TX_BUFFER_SIZE=64
CDEFS += -DUART_DEFAULT_BAUD_RATE=115200
# override default CTRL buffer sizes
CDEFS += -DCTRL_RX_BUFFER_SIZE=32
CDEFS += -DCTRL_TX_BUFFER_SIZE=128
# Place -I options here
CINCS =
#---------------- Compiler Options ----------------
# -g*: generate debugging information
# -O*: optimization level
# -f...: tuning, see GCC manual and avr-libc documentation
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
CFLAGS = -g$(DEBUG)
CFLAGS += $(CDEFS) $(CINCS)
CFLAGS += -O$(OPT)
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -Wall -Wstrict-prototypes
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
CFLAGS += $(CSTANDARD)
#---------------- Assembler Options ----------------
# -Wa,...: tell GCC to pass this to the assembler.
# -ahlms: create listing
# -gstabs: have the assembler create line number information; note that
# for use in COFF files, additional information about filenames
# and function names needs to be present in the assembler source
# files -- see avr-libc docs [FIXME: not yet described there]
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
#---------------- Library Options ----------------
# Minimalistic printf version
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
# Floating point printf version (requires MATH_LIB = -lm below)
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
# If this is left blank, then it will use the Standard printf version.
#PRINTF_LIB =
PRINTF_LIB = $(PRINTF_LIB_MIN)
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
# Minimalistic scanf version
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
# If this is left blank, then it will use the Standard scanf version.
#SCANF_LIB =
SCANF_LIB = $(SCANF_LIB_MIN)
#SCANF_LIB = $(SCANF_LIB_FLOAT)
MATH_LIB = -lm
#---------------- External Memory Options ----------------
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
# used for variables (.data/.bss) and heap (malloc()).
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
# only used for heap (malloc()).
#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff
EXTMEMOPTS =
#---------------- Linker Options ----------------
# -Wl,...: tell GCC to pass this to linker.
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
LDFLAGS += $(EXTMEMOPTS)
#LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
#---------------- Programming Options (avrdude) ----------------
# Programming hardware: alf avr910 avrisp bascom bsd
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
#
# Type: avrdude -c ?
# to get a full listing.
#
AVRDUDE_PROGRAMMER = usbtiny
AVRDUDE_PROGRAMMER_R = gpio
# com1 = serial port. Use lpt1 to connect to parallel port.
AVRDUDE_PORT = /dev/ttyUSB* # programmer connected to serial device
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
AVRDUDE_WRITE_FUSES = -U lfuse:w:0xEC:m -U hfuse:w:0xD6:m -U efuse:w:0x01:m
# Uncomment the following if you want avrdude's erase cycle counter.
# Note that this counter needs to be initialized first using -Yn,
# see avrdude manual.
#AVRDUDE_ERASE_COUNTER = -y
# Uncomment the following if you do /not/ wish a verification to be
# performed after programming the device.
#AVRDUDE_NO_VERIFY = -V
# Increase verbosity level. Please use this when submitting bug
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
# to submit bug reports.
#AVRDUDE_VERBOSE = -v -v
AVRDUDE_FLAGS = -p $(MCU)p -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
AVRDUDE_FLAGS_R = -p $(MCU)p -c $(AVRDUDE_PROGRAMMER_R)
AVRDUDE_FLAGS_R += $(AVRDUDE_NO_VERIFY)
AVRDUDE_FLAGS_R += $(AVRDUDE_VERBOSE)
AVRDUDE_FLAGS_R += $(AVRDUDE_ERASE_COUNTER)
#---------------- Debugging Options ----------------
# For simulavr only - target MCU frequency.
DEBUG_MFREQ = $(F_CPU)
# Set the DEBUG_UI to either gdb or insight.
# DEBUG_UI = gdb
DEBUG_UI = insight
# Set the debugging back-end to either avarice, simulavr.
DEBUG_BACKEND = avarice
#DEBUG_BACKEND = simulavr
# GDB Init Filename.
GDBINIT_FILE = __avr_gdbinit
# When using avarice settings for the JTAG
JTAG_DEV = /dev/com1
# Debugging port used to communicate between GDB / avarice / simulavr.
DEBUG_PORT = 4242
# Debugging host used to communicate between GDB / avarice / simulavr, normally
# just set to localhost unless doing some sort of crazy debugging when
# avarice is running on a different computer.
DEBUG_HOST = localhost
#============================================================================
# Define programs and commands.
SHELL = sh
CC = avr-gcc
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
NM = avr-nm
AVRDUDE = avrdude
AVRDUDE_R = fdude
REMOVE = rm -f
COPY = cp
WINSHELL = cmd
# Define Messages
# English
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = -------- end --------
MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
MSG_FLASH = Creating load file for Flash:
MSG_EEPROM = Creating load file for EEPROM:
MSG_EXTENDED_LISTING = Creating Extended Listing:
MSG_SYMBOL_TABLE = Creating Symbol Table:
MSG_LINKING = Linking:
MSG_COMPILING = Compiling:
MSG_ASSEMBLING = Assembling:
MSG_CLEANING = Cleaning project:
# Define all object files.
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
# Define all listing files.
LST = $(SRC:.c=.lst) $(ASRC:.S=.lst)
# Compiler flags to generate dependency files.
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
# Combine all necessary flags and optional flags.
# Add target processor to flags.
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target.
all: begin gccversion sizebefore build sizeafter end
build: elf hex eep lss sym
elf: $(TARGET).elf
hex: $(TARGET).hex
eep: $(TARGET).eep
lss: $(TARGET).lss
sym: $(TARGET).sym
# Eye candy.
# AVR Studio 3.x does not check make's exit code but relies on
# the following magic strings to be generated by the compile job.
begin:
@echo
@echo $(MSG_BEGIN)
end:
@echo $(MSG_END)
@echo
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
ELFSIZE = $(SIZE) -A $(TARGET).elf
AVRMEM = avr-mem.sh $(TARGET).elf $(MCU)
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
$(AVRMEM) 2>/dev/null; echo; fi
sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
$(AVRMEM) 2>/dev/null; echo; fi
# Display compiler version information.
gccversion :
@$(CC) --version
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FUSES) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
# Program the device remotely.
FLUKSO = /etc/init.d/flukso
rprogram: $(TARGET).hex $(TARGET).eep
@scp $(TARGET).hex $(TARGET).eep root@192.168.255.1:/tmp
@ssh root@192.168.255.1 \
"echo +++ stopping the flukso daemon +++;" \
"$(FLUKSO) stop;" \
"cd /tmp;" \
"$(AVRDUDE_R) $(AVRDUDE_FLAGS_R) $(AVRDUDE_WRITE_FUSES) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM);" \
"sleep 1;" \
"echo;" \
"echo +++ starting the flukso daemon +++;" \
"$(FLUKSO) start <&- 2>&- >/dev/null"
# Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set
# a breakpoint at main().
gdb-config:
@$(REMOVE) $(GDBINIT_FILE)
@echo define reset >> $(GDBINIT_FILE)
@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
@echo end >> $(GDBINIT_FILE)
@echo file $(TARGET).elf >> $(GDBINIT_FILE)
@echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
ifeq ($(DEBUG_BACKEND),simulavr)
@echo load >> $(GDBINIT_FILE)
endif
@echo break main >> $(GDBINIT_FILE)
debug: gdb-config $(TARGET).elf
ifeq ($(DEBUG_BACKEND), avarice)
@echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
@$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
$(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
@$(WINSHELL) /c pause
else
@$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
$(DEBUG_MFREQ) --port $(DEBUG_PORT)
endif
@$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
COFFCONVERT=$(OBJCOPY) --debugging \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000
coff: $(TARGET).elf
@echo
@echo $(MSG_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
extcoff: $(TARGET).elf
@echo
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
# Create final output files (.hex, .eep) from ELF output file.
%.hex: %.elf
@echo
@echo $(MSG_FLASH) $@
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
%.eep: %.elf
@echo
@echo $(MSG_EEPROM) $@
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
# Create extended listing file from ELF output file.
%.lss: %.elf
@echo
@echo $(MSG_EXTENDED_LISTING) $@
$(OBJDUMP) -h -S $< > $@
# Create a symbol table from ELF output file.
%.sym: %.elf
@echo
@echo $(MSG_SYMBOL_TABLE) $@
$(NM) -n $< > $@
# Link: create ELF output file from object files.
.SECONDARY : $(TARGET).elf
.PRECIOUS : $(OBJ)
%.elf: $(OBJ)
@echo
@echo $(MSG_LINKING) $@
$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
# Compile: create object files from C source files.
%.o : %.c
@echo
@echo $(MSG_COMPILING) $<
$(CC) -c $(ALL_CFLAGS) $< -o $@
# Compile: create assembler files from C source files.
%.s : %.c
$(CC) -S $(ALL_CFLAGS) $< -o $@
# Assemble: create object files from assembler source files.
%.o : %.S
@echo
@echo $(MSG_ASSEMBLING) $<
$(CC) -c $(ALL_ASFLAGS) $< -o $@
# Create preprocessed source for use in sending a bug report.
%.i : %.c
$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
# Target: clean project.
clean: begin clean_list end
clean_list :
@echo
@echo $(MSG_CLEANING)
$(REMOVE) $(TARGET).hex
$(REMOVE) $(TARGET).eep
$(REMOVE) $(TARGET).cof
$(REMOVE) $(TARGET).elf
$(REMOVE) $(TARGET).map
$(REMOVE) $(TARGET).sym
$(REMOVE) $(TARGET).lss
$(REMOVE) $(OBJ)
$(REMOVE) $(LST)
$(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d)
$(REMOVE) .dep/*
# Include the dependency files.
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
# Listing of phony targets.
.PHONY : all begin finish end sizebefore sizeafter gccversion \
build elf hex eep lss sym coff extcoff \
clean clean_list program rprogram debug gdb-config

View File

@ -1,74 +0,0 @@
/*
* Copyright (c) 2009 Andrew Smallbone <andrew@rocketnumbernine.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <spi.h>
#ifdef __cplusplus
extern "C"{
#endif
#ifdef __ARDUINO__
#include <wiring.h>
#endif
void setup_spi(uint8_t mode, int dord, int interrupt, uint8_t clock)
{
// specify pin directions for SPI pins on port B
if (clock == SPI_SLAVE) { // if slave SS and SCK is input
DDRB &= ~(1<<SPI_MOSI_PIN); // input
DDRB |= (1<<SPI_MISO_PIN); // output
DDRB &= ~(1<<SPI_SS_PIN); // input
DDRB &= ~(1<<SPI_SCK_PIN);// input
} else {
DDRB |= (1<<SPI_MOSI_PIN); // output
DDRB &= ~(1<<SPI_MISO_PIN); // input
DDRB |= (1<<SPI_SCK_PIN);// output
DDRB |= (1<<SPI_SS_PIN);// output
}
SPCR = ((interrupt ? 1 : 0)<<SPIE) // interrupt enabled
| (1<<SPE) // enable SPI
| (dord<<DORD) // LSB or MSB
| (((clock != SPI_SLAVE) ? 1 : 0) <<MSTR) // Slave or Master
| (((mode & 0x02) == 2) << CPOL) // clock timing mode CPOL
| (((mode & 0x01)) << CPHA) // clock timing mode CPHA
| (((clock & 0x02) == 2) << SPR1) // cpu clock divisor SPR1
| ((clock & 0x01) << SPR0); // cpu clock divisor SPR0
SPSR = (((clock & 0x04) == 4) << SPI2X); // clock divisor SPI2X
}
void disable_spi()
{
SPCR = 0;
}
uint8_t send_spi(uint8_t out)
{
SPDR = out;
while (!(SPSR & (1<<SPIF)));
return SPDR;
}
uint8_t received_from_spi(uint8_t data)
{
SPDR = data;
return SPDR;
}

View File

@ -1,94 +0,0 @@
/*
* Copyright (c) 2009 Andrew Smallbone <andrew@rocketnumbernine.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _spi_h__
#define _spi_h__
#include <avr/io.h>
#ifdef __cplusplus
extern "C"{
#endif
// create alias for the different SPI chip pins - code assumes all on port B
#if (defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__))
#define SPI_SS_PIN PORTB0
#define SPI_SCK_PIN PORTB1
#define SPI_MOSI_PIN PORTB2
#define SPI_MISO_PIN PORTB3
#elif (defined(__AVR_ATmega48__) || defined(_AVR_ATmega88__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__))
#define SPI_SS_PIN PORTB2
#define SPI_SCK_PIN PORTB5
#define SPI_MOSI_PIN PORTB3
#define SPI_MISO_PIN PORTB4
#else
#error unknown processor - add to spi.h
#endif
// SPI clock modes
#define SPI_MODE_0 0x00 /* Sample (Rising) Setup (Falling) CPOL=0, CPHA=0 */
#define SPI_MODE_1 0x01 /* Setup (Rising) Sample (Falling) CPOL=0, CPHA=1 */
#define SPI_MODE_2 0x02 /* Sample (Falling) Setup (Rising) CPOL=1, CPHA=0 */
#define SPI_MODE_3 0x03 /* Setup (Falling) Sample (Rising) CPOL=1, CPHA=1 */
// data direction
#define SPI_LSB 1 /* send least significant bit (bit 0) first */
#define SPI_MSB 0 /* send most significant bit (bit 7) first */
// whether to raise interrupt when data received (SPIF bit received)
#define SPI_NO_INTERRUPT 0
#define SPI_INTERRUPT 1
// slave or master with clock diviser
#define SPI_SLAVE 0xF0
#define SPI_MSTR_CLK4 0x00 /* chip clock/4 */
#define SPI_MSTR_CLK16 0x01 /* chip clock/16 */
#define SPI_MSTR_CLK64 0x02 /* chip clock/64 */
#define SPI_MSTR_CLK128 0x03 /* chip clock/128 */
#define SPI_MSTR_CLK2 0x04 /* chip clock/2 */
#define SPI_MSTR_CLK8 0x05 /* chip clock/8 */
#define SPI_MSTR_CLK32 0x06 /* chip clock/32 */
// setup spi
void setup_spi(uint8_t mode, // timing mode SPI_MODE[0-4]
int dord, // data direction SPI_LSB|SPI_MSB
int interrupt, // whether to raise interrupt on recieve
uint8_t clock); // clock diviser
// disable spi
void disable_spi(void);
// send and receive a byte of data (master mode)
uint8_t send_spi(uint8_t out);
// receive the byte of data waiting on the SPI buffer and
// set the next byte to transfer - for use in slave mode
// when interrupts are enabled.
uint8_t received_from_spi(uint8_t out);
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@ -1,310 +0,0 @@
//
// uart.c : UART driver with buffer support
//
// Copyright (c) 2000-2002 Pascal Stang
// 2010 flukso.net
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#include <avr/io.h>
#include <avr/interrupt.h>
#include "buffer.h"
#include "uart.h"
// UART global variables
// flag variables
volatile u08 uartReadyTx; ///< uartReadyTx flag
volatile u08 uartBufferedTx; ///< uartBufferedTx flag
// receive and transmit buffers
cBuffer uartRxBuffer; ///< uart receive buffer
cBuffer uartTxBuffer; ///< uart transmit buffer
unsigned short uartRxOverflow; ///< receive overflow counter
#ifndef UART_BUFFERS_EXTERNAL_RAM
// using internal ram,
// automatically allocate space in ram for each buffer
static char uartRxData[UART_RX_BUFFER_SIZE];
static char uartTxData[UART_TX_BUFFER_SIZE];
#endif
typedef void (*voidFuncPtru08)(unsigned char);
volatile static voidFuncPtru08 UartRxFunc;
// enable and initialize the uart
void uartInit(void)
{
// initialize the buffers
uartInitBuffers();
// initialize user receive handler
UartRxFunc = 0;
// enable RxD/TxD and interrupts
outb(UCR, BV(RXCIE)|BV(RXEN)|BV(TXEN));
// set default baud rate
uartSetBaudRate(UART_DEFAULT_BAUD_RATE);
// initialize states
uartReadyTx = TRUE;
uartBufferedTx = FALSE;
// clear overflow count
uartRxOverflow = 0;
// enable interrupts
sei();
}
// create and initialize the uart transmit and receive buffers
void uartInitBuffers(void)
{
#ifndef UART_BUFFERS_EXTERNAL_RAM
// initialize the UART receive buffer
bufferInit(&uartRxBuffer, (u08*) uartRxData, UART_RX_BUFFER_SIZE);
// initialize the UART transmit buffer
bufferInit(&uartTxBuffer, (u08*) uartTxData, UART_TX_BUFFER_SIZE);
#else
// initialize the UART receive buffer
bufferInit(&uartRxBuffer, (u08*) UART_RX_BUFFER_ADDR, UART_RX_BUFFER_SIZE);
// initialize the UART transmit buffer
bufferInit(&uartTxBuffer, (u08*) UART_TX_BUFFER_ADDR, UART_TX_BUFFER_SIZE);
#endif
}
// redirects received data to a user function
void uartSetRxHandler(void (*rx_func)(unsigned char c))
{
// set the receive interrupt to run the supplied user function
UartRxFunc = rx_func;
}
// set the uart baud rate
void uartSetBaudRate(u32 baudrate)
{
// calculate division factor for requested baud rate, and set it
u16 bauddiv = ((F_CPU+(baudrate*8L))/(baudrate*16L)-1);
outb(UBRRL, bauddiv);
#ifdef UBRRH
outb(UBRRH, bauddiv>>8);
#endif
}
// returns the receive buffer structure
cBuffer* uartGetRxBuffer(void)
{
// return rx buffer pointer
return &uartRxBuffer;
}
// returns the transmit buffer structure
cBuffer* uartGetTxBuffer(void)
{
// return tx buffer pointer
return &uartTxBuffer;
}
// transmits a byte over the uart
void uartSendByte(u08 txData)
{
// wait for the transmitter to be ready
while(!uartReadyTx);
// send byte
outb(UDR, txData);
// set ready state to FALSE
uartReadyTx = FALSE;
}
// gets a single byte from the uart receive buffer (getchar-style)
int uartGetByte(void)
{
u08 c;
if(uartReceiveByte(&c))
return c;
else
return -1;
}
// gets a byte (if available) from the uart receive buffer
u08 uartReceiveByte(u08* rxData)
{
// make sure we have a receive buffer
if(uartRxBuffer.size)
{
// make sure we have data
if(uartRxBuffer.datalength)
{
// get byte from beginning of buffer
*rxData = bufferGetFromFront(&uartRxBuffer);
return TRUE;
}
else
{
// no data
return FALSE;
}
}
else
{
// no buffer
return FALSE;
}
}
// flush all data out of the receive buffer
void uartFlushReceiveBuffer(void)
{
// flush all data from receive buffer
//bufferFlush(&uartRxBuffer);
// same effect as above
uartRxBuffer.datalength = 0;
}
// return true if uart receive buffer is empty
u08 uartReceiveBufferIsEmpty(void)
{
if(uartRxBuffer.datalength == 0)
{
return TRUE;
}
else
{
return FALSE;
}
}
// add byte to end of uart Tx buffer
u08 uartAddToTxBuffer(u08 data)
{
u08 status;
// add data byte to the end of the tx buffer
status = bufferAddToEnd(&uartTxBuffer, data);
// turn on buffered transmit
uartBufferedTx = TRUE;
// enable UDRIE0 interrupt
UCR |= 1<<UDRIE0;
return status;
}
// start transmission of the current uart Tx buffer contents
void uartSendTxBuffer(void)
{
// turn on buffered transmit
uartBufferedTx = TRUE;
// send the first byte to get things going by interrupts
uartSendByte(bufferGetFromFront(&uartTxBuffer));
}
/*
// transmit nBytes from buffer out the uart
u08 uartSendBuffer(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.datalength + nBytes < uartTxBuffer.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, *buffer++);
}
// send the first byte to get things going by interrupts
uartBufferedTx = TRUE;
uartSendByte(first);
// return success
return TRUE;
}
else
{
// return failure
return FALSE;
}
}
*/
// UART Data Register Empty Interrupt Handler
UART_INTERRUPT_HANDLER(SIG_UART_DATA)
{
// check if buffered tx is enabled
if(uartBufferedTx)
{
// check if there's data left in the buffer
if(uartTxBuffer.datalength)
{
// set RS-485 into transmit mode
PORTD |= (1<<PD5);
// send byte from top of buffer
outb(UDR, bufferGetFromFront(&uartTxBuffer));
}
else
{
// no data left
uartBufferedTx = FALSE;
// return to ready state
uartReadyTx = TRUE;
// disable UDRIE0 interrupt
UCR &= ~(1<<UDRIE0);
// enable TXCIE0 interrupt
UCR |= (1<<TXCIE0);
}
}
else
{
// we're using single-byte tx mode
// indicate transmit complete, back to ready
uartReadyTx = TRUE;
}
}
// UART Transmit Complete Interrupt Handler
UART_INTERRUPT_HANDLER(SIG_UART_TRANS)
{
// set RS-485 into receive mode
PORTD &= ~(1<<PD5);
// disable TXCIE0 interrupt
UCR &= ~(1<<TXCIE0);
}
// UART Receive Complete Interrupt Handler
UART_INTERRUPT_HANDLER(SIG_UART_RECV)
{
u08 c;
// get received char
c = inb(UDR);
// if there's a user function to handle this receive event
if(UartRxFunc)
{
// call it and pass the received data
UartRxFunc(c);
}
else
{
// otherwise do default processing
// put received char in buffer
// check if there's space
if( !bufferAddToEnd(&uartRxBuffer, c) )
{
// no space in buffer
// count overflow
uartRxOverflow++;
}
}
}

View File

@ -1,231 +0,0 @@
//
// uart.h : UART driver with buffer support
//
// This library provides both buffered and unbuffered transmit and receive
// functions for the AVR processor UART.<2E> Buffered access means that the
// UART can transmit and receive data in the "background", while your code
// continues executing.<2E> Also included are functions to initialize the
// UART, set the baud rate, flush the buffers, and check buffer status.
//
// For full text output functionality, you may wish to use the rprintf
// functions along with this driver.
//
// 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).
//
// 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:
// uartInit(); // initialize UART (serial port)
// uartSetBaudRate(9600); // set UART speed to 9600 baud
// rprintfInit(uartSendByte); // configure rprintf to use UART for output
// rprintf("Hello World\r\n"); // send "hello world" message via serial port
//
// 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.
//
// Copyright (c) 2000-2002 Pascal Stang
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#ifndef UART_H
#define UART_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().
#ifndef UART_DEFAULT_BAUD_RATE
#define UART_DEFAULT_BAUD_RATE 9600
#endif
// buffer memory allocation defines
// buffer sizes
#ifndef UART_TX_BUFFER_SIZE
//! Number of bytes for uart transmit buffer.
/// Do not change this value in uart.h, but rather override
/// it with the desired value defined in your project's global.h
#define UART_TX_BUFFER_SIZE 0x0040
#endif
#ifndef UART_RX_BUFFER_SIZE
//! Number of bytes for uart receive buffer.
/// Do not change this value in uart.h, but rather override
/// it with the desired value defined in your project's global.h
#define UART_RX_BUFFER_SIZE 0x0040
#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 uart buffers
#define UART_TX_BUFFER_ADDR 0x1000
#define UART_RX_BUFFER_ADDR 0x1100
#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 with most newer processors
#ifdef UCSRB
#define UCR UCSRB
#endif
// compatibility with old Mega processors
#if defined(UBRR) && !defined(UBRRL)
#define UBRRL UBRR
#endif
// compatibility with megaXX8 processors
#if defined(__AVR_ATmega48__) || \
defined(__AVR_ATmega88__) || \
defined(__AVR_ATmega168__) || \
defined(__AVR_ATmega644__)
#define UDR UDR0
#define UCR UCSR0B
#define RXCIE RXCIE0
#define TXCIE TXCIE0
#define RXC RXC0
#define TXC TXC0
#define RXEN RXEN0
#define TXEN TXEN0
#define UBRRL UBRR0L
#define UBRRH UBRR0H
#define SIG_UART_TRANS SIG_USART_TRANS
#define SIG_UART_RECV SIG_USART_RECV
#define SIG_UART_DATA SIG_USART_DATA
#endif
// compatibility with mega169 processors
#if defined(__AVR_ATmega169__)
#define SIG_UART_TRANS SIG_USART_TRANS
#define SIG_UART_RECV SIG_USART_RECV
#define SIG_UART_DATA SIG_USART_DATA
#endif
// compatibility with dual-uart processors
// (if you need to use both uarts, please use the uart2 library)
#if defined(__AVR_ATmega161__)
#define UDR UDR0
#define UCR UCSR0B
#define UBRRL UBRR0
#define SIG_UART_TRANS SIG_UART0_TRANS
#define SIG_UART_RECV SIG_UART0_RECV
#define SIG_UART_DATA SIG_UART0_DATA
#endif
#if defined(__AVR_ATmega128__)
#ifdef UART_USE_UART1
#define UDR UDR1
#define UCR UCSR1B
#define UBRRL UBRR1L
#define UBRRH UBRR1H
#define SIG_UART_TRANS SIG_UART1_TRANS
#define SIG_UART_RECV SIG_UART1_RECV
#define SIG_UART_DATA SIG_UART1_DATA
#else
#define UDR UDR0
#define UCR UCSR0B
#define UBRRL UBRR0L
#define UBRRH UBRR0H
#define SIG_UART_TRANS SIG_UART0_TRANS
#define SIG_UART_RECV SIG_UART0_RECV
#define SIG_UART_DATA SIG_UART0_DATA
#endif
#endif
// functions
//! Initializes uart.
/// \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 transmit and receive buffers.
/// Automatically called from uartInit()
void uartInitBuffers(void);
//! Redirects received data to a user function.
///
void uartSetRxHandler(void (*rx_func)(unsigned char c));
//! Sets the uart baud rate.
/// Argument should be in bits-per-second, like \c uartSetBaudRate(9600);
void uartSetBaudRate(u32 baudrate);
//! Returns pointer to the receive buffer structure.
///
cBuffer* uartGetRxBuffer(void);
//! Returns pointer to the transmit buffer structure.
///
cBuffer* uartGetTxBuffer(void);
//! Sends a single byte over the uart.
/// \note This function waits for the uart to be ready,
/// therefore, consecutive calls to uartSendByte() will
/// go only as fast as the data can be sent over the
/// serial port.
void uartSendByte(u08 data);
//! Gets a single byte from the uart receive buffer.
/// Returns the byte, or -1 if no byte is available (getchar-style).
int uartGetByte(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( &myReceivedByte );
/// \endcode
u08 uartReceiveByte(u08* data);
//! Returns TRUE/FALSE if receive buffer is empty/not-empty.
///
u08 uartReceiveBufferIsEmpty(void);
//! Flushes (deletes) all data from receive buffer.
///
void uartFlushReceiveBuffer(void);
//! Add byte to end of uart Tx buffer.
/// Returns TRUE if successful, FALSE if failed (no room left in buffer).
u08 uartAddToTxBuffer(u08 data);
//! Begins transmission of the transmit buffer under interrupt control.
///
void uartSendTxBuffer(void);
//! Sends a block of data via the uart using interrupt control.
/// \param buffer pointer to data to be sent
/// \param nBytes length of data (number of bytes to sent)
u08 uartSendBuffer(char *buffer, u16 nBytes);
#endif

View File

@ -1,154 +0,0 @@
[CAM Processor Job]
Description[en]="<b>Generates Extended Gerber Format</b><p>\nThis CAM job consists of five sections that generate data for a two layer board.<p><p>\nYou will get five gerber files that contain data for:<br>\ncomponent side *.cmp<br>\nsolder side *.sol<br>\nsilkscreen component side *.plc<br>\nsolder stop component side *.stc<br>\nsolder stop solder sid *.sts<br>"
Section=Sec_1
Section=Sec_2
Section=Sec_3
Section=Sec_4
Section=Sec_5
Section=Sec_6
Section=Sec_7
Section=Sec_8
[Sec_1]
Name[en]="Top Copper"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=""
Rack=""
Scale=1
Output=".GTL"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 1 17 18 20"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_2]
Name[en]="Bottom Copper"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output=".GBL"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 16 17 18"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_3]
Name[en]="Top Silkscreen"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output=".GTO"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 21 25"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_4]
Name[en]="Top Paste"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output=".GTP"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 31"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_5]
Name[en]="Bottom Silkscreen"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=""
Rack=""
Scale=1
Output=".GBO"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 22"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_6]
Name[en]="Top Soldermask"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output=".GTS"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 29"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_7]
Name[en]="Bottom Soldermask"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output=".GBS"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 30"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_8]
Name[en]="Drill File"
Prompt[en]=""
Device="EXCELLON"
Wheel=""
Rack="/Users/icarus75/Documents/eagle/flukso.sensor.board.v2.0/flukso.sensor.board.v2.0.DRL"
Scale=1
Output=".DRD"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 44 45"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"

View File

@ -1,72 +0,0 @@
description[en] = <b>EAGLE Design Rules</b>\n<p>\nThe default Design Rules have been set to cover\na wide range of applications. Your particular design\nmay have different requirements, so please make the\nnecessary adjustments and save your customized\ndesign rules under a new name.
layerSetup = (1*16)
mtCopper = 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm
mtIsolate = 1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm
mdWireWire = 10mil
mdWirePad = 10mil
mdWireVia = 10mil
mdPadPad = 10mil
mdPadVia = 10mil
mdViaVia = 10mil
mdSmdPad = 10mil
mdSmdVia = 10mil
mdSmdSmd = 10mil
mdViaViaSameLayer = 8mil
mnLayersViaInSmd = 2
mdCopperDimension = 40mil
mdDrill = 10mil
mdSmdStop = 0mil
msWidth = 10mil
msDrill = 24mil
msMicroVia = 9.99mm
msBlindViaRatio = 0.500000
rvPadTop = 0.250000
rvPadInner = 0.250000
rvPadBottom = 0.250000
rvViaOuter = 0.250000
rvViaInner = 0.250000
rvMicroViaOuter = 0.250000
rvMicroViaInner = 0.250000
rlMinPadTop = 10mil
rlMaxPadTop = 20mil
rlMinPadInner = 10mil
rlMaxPadInner = 20mil
rlMinPadBottom = 10mil
rlMaxPadBottom = 20mil
rlMinViaOuter = 8mil
rlMaxViaOuter = 20mil
rlMinViaInner = 8mil
rlMaxViaInner = 20mil
rlMinMicroViaOuter = 4mil
rlMaxMicroViaOuter = 20mil
rlMinMicroViaInner = 4mil
rlMaxMicroViaInner = 20mil
psTop = -1
psBottom = -1
psFirst = -1
psElongationLong = 100
psElongationOffset = 100
mvStopFrame = 0.100000
mvCreamFrame = 0.000000
mlMinStopFrame = 0mil
mlMaxStopFrame = 20mil
mlMinCreamFrame = 0mil
mlMaxCreamFrame = 0mil
mlViaStopLimit = 0mil
srRoundness = 0.000000
srMinRoundness = 0mil
srMaxRoundness = 0mil
slThermalGap = 0.500000
slMinThermalGap = 20mil
slMaxThermalGap = 100mil
slAnnulusIsolate = 20mil
slThermalIsolate = 10mil
slAnnulusRestring = 0
slThermalRestring = 1
slThermalsForVias = 0
checkGrid = 0
checkAngle = 0
checkFont = 1
checkRestrict = 1
useDiameter = 13
maxErrors = 50

View File

@ -1,72 +0,0 @@
description = <b>EAGLE Design Rules</b>\n<p>\nThe default Design Rules have been set to cover\na wide range of applications. Your particular design\nmay have different requirements, so please make the\nnecessary adjustments and save your customized\ndesign rules under a new name.
layerSetup = (1*16)
mtCopper = 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm
mtIsolate = 1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm
mdWireWire = 8mil
mdWirePad = 8mil
mdWireVia = 8mil
mdPadPad = 8mil
mdPadVia = 8mil
mdViaVia = 8mil
mdSmdPad = 8mil
mdSmdVia = 8mil
mdSmdSmd = 8mil
mdViaViaSameLayer = 8mil
mnLayersViaInSmd = 2
mdCopperDimension = 40mil
mdDrill = 10mil
mdSmdStop = 0mil
msWidth = 8mil
msDrill = 0.6mm
msMicroVia = 0mil
msBlindViaRatio = 0.000000
rvPadTop = 0.250000
rvPadInner = 0.250000
rvPadBottom = 0.250000
rvViaOuter = 0.250000
rvViaInner = 0.250000
rvMicroViaOuter = 0.250000
rvMicroViaInner = 0.250000
rlMinPadTop = 10mil
rlMaxPadTop = 20mil
rlMinPadInner = 10mil
rlMaxPadInner = 20mil
rlMinPadBottom = 10mil
rlMaxPadBottom = 20mil
rlMinViaOuter = 8mil
rlMaxViaOuter = 20mil
rlMinViaInner = 8mil
rlMaxViaInner = 20mil
rlMinMicroViaOuter = 8mil
rlMaxMicroViaOuter = 20mil
rlMinMicroViaInner = 8mil
rlMaxMicroViaInner = 20mil
psTop = -1
psBottom = -1
psFirst = -1
psElongationLong = 100
psElongationOffset = 100
mvStopFrame = 0.100000
mvCreamFrame = 0.000000
mlMinStopFrame = 0mil
mlMaxStopFrame = 20mil
mlMinCreamFrame = 0mil
mlMaxCreamFrame = 0mil
mlViaStopLimit = 0mil
srRoundness = 0.000000
srMinRoundness = 0mil
srMaxRoundness = 0mil
slThermalGap = 0.500000
slMinThermalGap = 20mil
slMaxThermalGap = 100mil
slAnnulusIsolate = 20mil
slThermalIsolate = 10mil
slAnnulusRestring = 0
slThermalRestring = 1
slThermalsForVias = 0
checkGrid = 0
checkAngle = 0
checkFont = 1
checkRestrict = 1
useDiameter = 13
maxErrors = 50

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
To set up a customized OpenWRT Backfire build environment for Flukso targets, just run:
. ./install.sh /your/preferred/backfire/installation/path

View File

@ -1,14 +0,0 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Flukso RESTful API on %h</name>
<service>
<type>_flukso._tcp</type>
<port>8080</port>
<txt-record>id1=0123456789abcdef0123456789abcde0</txt-record>
<txt-record>id2=0123456789abcdef0123456789abcde1</txt-record>
<txt-record>id3=0123456789abcdef0123456789abcde2</txt-record>
<txt-record>path=/sensor</txt-record>
<txt-record>version=1.0</txt-record>
</service>
</service-group>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Web Server on %h</name>
<service>
<type>_http._tcp</type>
<port>80</port>
<txt-record>path=/</txt-record>
</service>
</service-group>

View File

@ -1,23 +0,0 @@
config dnsmasq
option domainneeded 1
option boguspriv 1
option filterwin2k '0' #enable for dial on demand
option localise_queries 1
option local '/lan/'
option domain 'home'
option expandhosts 1
option nonegcache 0
option authoritative 1
option readethers 1
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
config dhcp
option interface lan
option start 100
option limit 150
option leasetime 12h
config dhcp
option interface wan
option ignore 1

View File

@ -1,3 +0,0 @@
config dropbear
option PasswordAuth 'on'
option Port '22'

View File

@ -1,113 +0,0 @@
config defaults
option syn_flood 1
option input ACCEPT
option output ACCEPT
option forward REJECT
# Uncomment this line to disable ipv6 rules
# option disable_ipv6 1
config zone
option name lan
option input ACCEPT
option output ACCEPT
option forward REJECT
config zone
option name wan
option input REJECT
option output ACCEPT
option forward REJECT
option masq 1
option mtu_fix 1
config forwarding
option src lan
option dest wan
# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
option src wan
option proto udp
option dest_port 68
option target ACCEPT
option family ipv4
#Allow ping
config rule
option src wan
option proto icmp
option icmp_type echo-request
option target ACCEPT
#Allow access to local REST API on the wan itf
config rule
option src wan
option proto tcp
option dest_port 8080
option target ACCEPT
#Open up UDP port 5353 on the wan for avahi
config rule
option src wan
option proto udp
option dest_port 5353
option target ACCEPT
# include a file with users custom iptables rules
config include
option path /etc/firewall.user
### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
# option src lan
# option src_ip 192.168.45.2
# option dest wan
# option proto tcp
# option target REJECT
# block a specific mac on wan
#config rule
# option dest wan
# option src_mac 00:11:22:33:44:66
# option target REJECT
# block incoming ICMP traffic on a zone
#config rule
# option src lan
# option proto ICMP
# option target DROP
# port redirect port coming in on wan to lan
#config redirect
# option src wan
# option src_dport 80
# option dest lan
# option dest_ip 192.168.16.235
# option dest_port 80
# option proto tcp
### FULL CONFIG SECTIONS
#config rule
# option src lan
# option src_ip 192.168.45.2
# option src_mac 00:11:22:33:44:55
# option src_port 80
# option dest wan
# option dest_ip 194.25.2.129
# option dest_port 120
# option proto tcp
# option target REJECT
#config redirect
# option src lan
# option src_ip 192.168.45.2
# option src_mac 00:11:22:33:44:55
# option src_port 1024
# option src_dport 80
# option dest_ip 194.25.2.129
# option dest_port 120
# option proto tcp

View File

@ -1,17 +0,0 @@
# Copyright (C) 2006 OpenWrt.org
config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
config interface wan
option ifname ath0
option proto dhcp
config interface lan
option ifname eth0
option proto static
option ipaddr 192.168.255.1
option netmask 255.255.255.0

View File

@ -1,22 +0,0 @@
config system
option timezone UTC
option hostname flukso
option device 0123456789abcdef0123456789abcdef
option key 00112233445566778899aabbccddeeff
option version 210
option firstboot 1
option cronloglevel 1
config button
option button reset
option action released
option handler net_toggle
option min 2
option max 5
config button
option button reset
option action released
option handler net_defaults
option min 10
option max 30

View File

@ -1,83 +0,0 @@
# Server configuration
config uhttpd main
# HTTP listen addresses, multiple allowed
list listen_http 0.0.0.0:80
# list listen_http [::]:80
# HTTPS listen addresses, multiple allowed
# list listen_https 0.0.0.0:443
# list listen_https [::]:443
# Server document root
option home /www
# Reject requests from RFC1918 IP addresses
# directed to the servers public IP(s).
# This is a DNS rebinding countermeasure.
option rfc1918_filter 1
# Certificate and private key for HTTPS.
# If no listen_https addresses are given,
# the key options are ignored.
option cert /etc/uhttpd.crt
option key /etc/uhttpd.key
# CGI url prefix, will be searched in docroot.
# Default is /cgi-bin
option cgi_prefix /cgi-bin
# List of extension->interpreter mappings.
# Files with an associated interpreter can
# be called outside of the CGI prefix and do
# not need to be executable.
# list interpreter ".php=/usr/bin/php-cgi"
# list interpreter ".cgi=/usr/bin/perl"
# Lua url prefix and handler script.
# Lua support is disabled if no prefix given.
# option lua_prefix /luci
# option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua
# CGI/Lua timeout, if the called script does not
# write data within the given amount of seconds,
# the server will terminate the request with
# 504 Gateway Timeout response.
option script_timeout 60
# Network timeout, if the current connection is
# blocked for the specified amount of seconds,
# the server will terminate the associated
# request process.
option network_timeout 30
# Basic auth realm, defaults to local hostname
# option realm OpenWrt
# Configuration file in busybox httpd format
# option config /etc/httpd.conf
config uhttpd restful
list listen_http 0.0.0.0:8080
option home /www
option cgi_prefix /sensor
option script_timeout 5
option network_timeout 5
# Certificate defaults for px5g key generator
config cert px5g
# Validity time
option days 730
# RSA key size
option bits 1024
# Location
option country DE
option state Berlin
option location Berlin
# Common name
option commonname OpenWrt

View File

@ -1,18 +0,0 @@
config wifi-device wifi0
option type atheros
option channel auto
option mode 11bg
option diversity 0
option txantenna 1
option rxantenna 1
option disabled 0
config wifi-iface
option device wifi0
option network wan
option mode sta
option nosbeacon 1
option hidden 0
option ssid zwaluw
option encryption wep
option key 4ae56b7820f6b6b3cba78da46b

View File

@ -1,3 +0,0 @@
root:x:0:
flukso:x:1:
nogroup:x:65534:

View File

@ -1,2 +0,0 @@
127.0.0.1 localhost
192.168.255.1 flukso

View File

@ -1,2 +0,0 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop

View File

@ -1,4 +0,0 @@
root:$1$VtdkJasi$HdGYp/XcbJmQ3BInhA/ki/:0:0:root:/root:/bin/ash
flukso:*:1:1:flukso:/var:/bin/false
nobody:*:65534:65534:nobody:/var:/bin/false
daemon:*:65534:65534:daemon:/var:/bin/false

View File

@ -1,11 +0,0 @@
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
# set the globe led pin (=GPIO 5) direction to output
gpioctl dirout 5
# turn the globe led pin off (inverted logic)
gpioctl set 5
# set the wifi led pin (=GPIO 7) direction to output
gpioctl dirout 7
exit 0

View File

@ -1,21 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIDfzCCAmegAwIBAgIJANYOkpI6yVcFMA0GCSqGSIb3DQEBBQUAMDMxCzAJBgNV
BAYTAkJFMQ8wDQYDVQQKEwZGbHVrc28xEzARBgNVBAMTCmZsdWtzby5uZXQwHhcN
MTAwNjAxMjE1ODAyWhcNMzUwNTI2MjE1ODAyWjAzMQswCQYDVQQGEwJCRTEPMA0G
A1UEChMGRmx1a3NvMRMwEQYDVQQDEwpmbHVrc28ubmV0MIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEA6CtNI3YrF/7Ak3etIe+XnL4HwJYki4PyaWI4S7W1
49C9W5AEbEd7ufnsaku3eVxMqOP6b5L7MFpCCGDiM1Zt32yYAcL65eCrofZw1DE0
SuWos0Z1P4y2rIUFHya8g8bUh7lUvq30IBgnnUh7Lo0eQT1XfnC/KMUnvseHI/iw
Y3HhYX+espsCPh1a0ATLlEk93XK99q/5mgojSGQxmwPj/91mOWmJOO4edEQAhK+u
t6wCNxZNnf9yyyzzLczwMytfrwBWJEJjJFTfr3JiEmHdl4dt7UiuElGLMr9dFhPV
12Bidxszov663ffUiIUmV/fkMWF1ZEWXFS0x+VJ52seChwIDAQABo4GVMIGSMB0G
A1UdDgQWBBQGMvERFrapN1lmOm9SVR8qB+uj/zBjBgNVHSMEXDBagBQGMvERFrap
N1lmOm9SVR8qB+uj/6E3pDUwMzELMAkGA1UEBhMCQkUxDzANBgNVBAoTBkZsdWtz
bzETMBEGA1UEAxMKZmx1a3NvLm5ldIIJANYOkpI6yVcFMAwGA1UdEwQFMAMBAf8w
DQYJKoZIhvcNAQEFBQADggEBAOZjgNoNhJLckVMEYZiYWqRDWeRPBkyGStCH93r3
42PpuKDyysxI1ldLTcUpUSrs1AtdSIEiEahWr6zVW4QW4o9iqO905E03aTO86L+P
j7SIBPP01M2f70pHpnz+uH1MDxsarI96qllslWfymYI7c6yUN/VciWfNWa38nK1l
MiQJuDvElNy8aN1JJtXHFUQK/I8ois1ATT1rGAiqrkDZIm4pdDmqB/zLI3qIJf8o
cKIo2x/YkVhuDmIpU/XVA13csXrXU+CLfFyNdY1a/6Dhv2B4wG6J5RGuxWmA+Igg
TTysD+aqqzs8XstqDu/aLjMzFKMaXNvDoCbdFQGVXfx0F1A=
-----END CERTIFICATE-----

View File

@ -1,28 +0,0 @@
kernel.panic=3
net.ipv4.conf.default.arp_ignore=1
net.ipv4.conf.all.arp_ignore=1
net.ipv4.ip_forward=1
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.icmp_ignore_bogus_error_responses=1
net.ipv4.tcp_ecn=0
net.ipv4.tcp_fin_timeout=30
net.ipv4.tcp_keepalive_time=120
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_timestamps=0
net.core.netdev_max_backlog=30
net.netfilter.nf_conntrack_checksum=0
net.ipv4.netfilter.ip_conntrack_checksum=0
net.ipv4.netfilter.ip_conntrack_max=16384
net.ipv4.netfilter.ip_conntrack_tcp_timeout_established=3600
net.ipv4.netfilter.ip_conntrack_udp_timeout=60
net.ipv4.netfilter.ip_conntrack_udp_timeout_stream=180
# net.ipv6.conf.all.forwarding=1
# disable bridge firewalling by default
net.bridge.bridge-nf-call-arptables=0
net.bridge.bridge-nf-call-ip6tables=0
net.bridge.bridge-nf-call-iptables=0
# blink the wifi led (= GPIO7)
dev.wifi0.softled=1
dev.wifi0.ledpin=7

View File

@ -1,87 +0,0 @@
#!/usr/bin/env bash
USAGE="Usage: . ./install /your/preferred/backfire/installation/path"
if (( $# < 1 ))
then
echo "Error. Not enough arguments."
echo $USAGE
exit 1
elif (( $# > 1 ))
then
echo "Error. Too many arguments."
echo $USAGE
exit 2
elif [ $1 == "--help" ]
then
echo $USAGE
exit 3
fi
REPO_PATH=$(pwd)
BACKFIRE_PATH=$1
# checkout the stock OpenWRT build environment to the path specified on the command line
mkdir -p $BACKFIRE_PATH
svn co svn://svn.openwrt.org/openwrt/branches/backfire $BACKFIRE_PATH
# add the specific flukso packages as a feed
echo "src-link flukso $REPO_PATH/package" > $BACKFIRE_PATH/feeds.conf
$BACKFIRE_PATH/scripts/feeds update
$BACKFIRE_PATH/scripts/feeds install -a -p flukso
# copy over the build config settings and the files directory
cp .config $BACKFIRE_PATH
cp -r files $BACKFIRE_PATH
# add patches to the toolchain
cp patches/990-add_timerfd_support.patch $BACKFIRE_PATH/toolchain/uClibc/patches-0.9.30.1
# add patches to the linux atheros target
cp patches/300-set_AR2315_RESET_GPIO_to_6.patch $BACKFIRE_PATH/target/linux/atheros/patches-2.6.30
cp patches/310-hotplug_button_jiffies_calc.patch $BACKFIRE_PATH/target/linux/atheros/patches-2.6.30
cp patches/400-spi_gpio_support.patch $BACKFIRE_PATH/target/linux/atheros/patches-2.6.30
cp patches/410-spi_gpio_enable_cs_line.patch $BACKFIRE_PATH/target/linux/atheros/patches-2.6.30
cp patches/420-tune_spi_bitbanging_for_avr.patch $BACKFIRE_PATH/target/linux/atheros/patches-2.6.30
# backport loglevel fix to busybox v1.15.3-2
# see: https://bugs.busybox.net/show_bug.cgi?id=681
cp patches/820-fix_crond_loglevel.patch $BACKFIRE_PATH/package/busybox/patches
# patch the default OpenWRT Lua package
rm $BACKFIRE_PATH/package/lua/patches/400-luaposix_5.1.4-embedded.patch
rm $BACKFIRE_PATH/package/lua/patches/500-eglibc_config.patch
cp patches/600-lua-tablecreate.patch $BACKFIRE_PATH/package/lua/patches
# copy flash utility to the tools dir
cp ../tools/ap51-flash $BACKFIRE_PATH/tools
# patch files of the OpenWRT build system
cd $BACKFIRE_PATH
patch -p0 < $REPO_PATH/patches/900-disable_console.patch
patch -p0 < $REPO_PATH/patches/910-set_ttyS0_baud_to_115200.patch
patch -p0 < $REPO_PATH/patches/920-add-make-flash-option.patch
# we don't need rdate, relying on ntpclient instead
rm $BACKFIRE_PATH/package/base-files/files/etc/hotplug.d/iface/40-rdate
# and then build the Fluksometer firmware...
echo
echo " ================================================= "
echo " To compile this custom Backfire build for Flukso, "
echo " just type make -j8 in the installation path you "
echo " selected. Use at least as many jobs as the number "
echo " of cores available on your build machine. "
echo
echo " IMPORTANT: make sure your machine has a recent "
echo " version of the gcc-avr toolchain (>= 4.3.4) and "
echo " avr-libc (>= 1.6.7) installed. "
echo
echo " To upload the firmware to the Fluksometer after "
echo " compilation, type make flash V=99. Then connect "
echo " the Fluksometer to your machine via ethernet and "
echo " power it up. "
echo
echo " Happy hacking! "
echo " ================================================= "
echo

View File

@ -1,68 +0,0 @@
10
dir
25991
svn://svn.openwrt.org/openwrt/packages/libs/avahi
svn://svn.openwrt.org/openwrt
2011-03-09T12:34:25.840259Z
25973
jow
3c298f89-4303-0410-b956-a3cf2f4a3e73
files
dir
patches
dir
Makefile
file
2011-03-10T08:41:40.084744Z
ffbac369cbd38b109da6e88e487209a2
2011-03-09T12:34:25.840259Z
25973
jow
has-props
5651

View File

@ -1,13 +0,0 @@
K 9
copyright
V 30
Copyright (C) 2006 OpenWrt.org
K 7
licence
V 5
GPLv2
K 13
svn:eol-style
V 6
native
END

View File

@ -1,196 +0,0 @@
#
# Copyright (C) 2007-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=avahi
PKG_VERSION:=0.6.29
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://avahi.org/download/
PKG_MD5SUM:=bb9d326770689610d1dbaceab5a787fc
PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/avahi/Default
SECTION:=net
CATEGORY:=Network
TITLE:=An mDNS/DNS-SD implementation
URL:=http://www.avahi.org/
endef
define Package/avahi/Default/description
An mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) implementation (library).
Avahi is a system which facilitates service discovery on a local network --
this means that you can plug your laptop or computer into a network and
instantly be able to view other people who you can chat with, find printers
to print to or find files being shared. This kind of technology is already
found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
and is very convenient.
endef
define Package/libavahi
$(call Package/avahi/Default)
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libdaemon +libpthread +libgdbm
TITLE+= (library)
endef
define Package/libavahi/description
$(call Package/avahi/Default/description)
.
This package contains the mDNS/DNS-SD shared libraries, used by other programs.
endef
define Package/avahi-autoipd
$(call Package/avahi/Default)
DEPENDS:=+libdaemon
TITLE:=IPv4LL network address configuration daemon
endef
define Package/avahi-autoipd/description
$(call Package/avahi/Default/description)
.
This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
from the link-local 169.254.0.0/16 range without the need for a central
server. It is primarily intended to be used in ad-hoc networks which lack a
DHCP server.
endef
define Package/avahi-daemon
$(call Package/avahi/Default)
DEPENDS:=+libavahi +libexpat
TITLE+= (daemon)
endef
define Package/avahi-daemon/description
$(call Package/avahi/Default/description)
.
This package contains an mDNS/DNS-SD daemon.
endef
define Package/avahi-daemon/conffiles
/etc/avahi/avahi-daemon.conf
/etc/avahi/services/http.service
/etc/avahi/services/ssh.service
endef
define Package/avahi-dnsconfd
$(call Package/avahi/Default)
DEPENDS:=+libavahi
TITLE:=An Unicast DNS server from mDNS/DNS-SD configuration daemon
endef
define Package/avahi-dnsconfd/description
$(call Package/avahi/Default/description)
.
This package contains an Unicast DNS server from mDNS/DNS-SD configuration
daemon, which may be used to configure conventional DNS servers using mDNS
in a DHCP-like fashion. Especially useful on IPv6.
endef
TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
CONFIGURE_ARGS+= \
--enable-shared \
--enable-static \
--disable-glib \
--disable-gobject \
--disable-qt3 \
--disable-qt4 \
--disable-gtk \
--disable-gtk3 \
--disable-dbus \
--with-xml=expat \
--disable-dbm \
--enable-gdbm \
--enable-libdaemon \
--disable-python \
--disable-pygtk \
--disable-python-dbus \
--disable-mono \
--disable-monodoc \
--disable-doxygen-doc \
--disable-doxygen-dot \
--disable-doxygen-man \
--disable-doxygen-rtf \
--disable-doxygen-xml \
--disable-doxygen-chm \
--disable-doxygen-chi \
--disable-doxygen-html \
--disable-doxygen-ps \
--disable-doxygen-pdf \
--disable-xmltoman \
--with-distro=none \
--with-avahi-user=nobody \
--with-avahi-group=nogroup \
--with-autoipd-user=nobody \
--with-autoipd-group=nogroup
ifneq ($(CONFIG_SSP_SUPPORT),y)
CONFIGURE_ARGS+= \
--disable-stack-protector
endif
CONFIGURE_VARS+= \
CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/avahi-{common,core} $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/avahi-core.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libavahi/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
endef
define Package/avahi-autoipd/install
$(INSTALL_DIR) $(1)/etc/avahi
$(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
endef
define Package/avahi-daemon/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/avahi
$(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
$(INSTALL_DIR) $(1)/etc/avahi/services
$(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
$(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
endef
define Package/avahi-dnsconfd/install
$(INSTALL_DIR) $(1)/etc/avahi
$(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,libavahi))
$(eval $(call BuildPackage,avahi-autoipd))
$(eval $(call BuildPackage,avahi-daemon))
$(eval $(call BuildPackage,avahi-dnsconfd))

View File

@ -1,196 +0,0 @@
#
# Copyright (C) 2007-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=avahi
PKG_VERSION:=0.6.29
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://avahi.org/download/
PKG_MD5SUM:=bb9d326770689610d1dbaceab5a787fc
PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/avahi/Default
SECTION:=net
CATEGORY:=Network
TITLE:=An mDNS/DNS-SD implementation
URL:=http://www.avahi.org/
endef
define Package/avahi/Default/description
An mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) implementation (library).
Avahi is a system which facilitates service discovery on a local network --
this means that you can plug your laptop or computer into a network and
instantly be able to view other people who you can chat with, find printers
to print to or find files being shared. This kind of technology is already
found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
and is very convenient.
endef
define Package/libavahi
$(call Package/avahi/Default)
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libdaemon +libpthread +libgdbm
TITLE+= (library)
endef
define Package/libavahi/description
$(call Package/avahi/Default/description)
.
This package contains the mDNS/DNS-SD shared libraries, used by other programs.
endef
define Package/avahi-autoipd
$(call Package/avahi/Default)
DEPENDS:=+libdaemon
TITLE:=IPv4LL network address configuration daemon
endef
define Package/avahi-autoipd/description
$(call Package/avahi/Default/description)
.
This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
from the link-local 169.254.0.0/16 range without the need for a central
server. It is primarily intended to be used in ad-hoc networks which lack a
DHCP server.
endef
define Package/avahi-daemon
$(call Package/avahi/Default)
DEPENDS:=+libavahi +libexpat
TITLE+= (daemon)
endef
define Package/avahi-daemon/description
$(call Package/avahi/Default/description)
.
This package contains an mDNS/DNS-SD daemon.
endef
define Package/avahi-daemon/conffiles
/etc/avahi/avahi-daemon.conf
/etc/avahi/services/http.service
/etc/avahi/services/ssh.service
endef
define Package/avahi-dnsconfd
$(call Package/avahi/Default)
DEPENDS:=+libavahi
TITLE:=An Unicast DNS server from mDNS/DNS-SD configuration daemon
endef
define Package/avahi-dnsconfd/description
$(call Package/avahi/Default/description)
.
This package contains an Unicast DNS server from mDNS/DNS-SD configuration
daemon, which may be used to configure conventional DNS servers using mDNS
in a DHCP-like fashion. Especially useful on IPv6.
endef
TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
CONFIGURE_ARGS+= \
--enable-shared \
--enable-static \
--disable-glib \
--disable-gobject \
--disable-qt3 \
--disable-qt4 \
--disable-gtk \
--disable-gtk3 \
--disable-dbus \
--with-xml=expat \
--disable-dbm \
--enable-gdbm \
--enable-libdaemon \
--disable-python \
--disable-pygtk \
--disable-python-dbus \
--disable-mono \
--disable-monodoc \
--disable-doxygen-doc \
--disable-doxygen-dot \
--disable-doxygen-man \
--disable-doxygen-rtf \
--disable-doxygen-xml \
--disable-doxygen-chm \
--disable-doxygen-chi \
--disable-doxygen-html \
--disable-doxygen-ps \
--disable-doxygen-pdf \
--disable-xmltoman \
--with-distro=none \
--with-avahi-user=nobody \
--with-avahi-group=nogroup \
--with-autoipd-user=nobody \
--with-autoipd-group=nogroup
ifneq ($(CONFIG_SSP_SUPPORT),y)
CONFIGURE_ARGS+= \
--disable-stack-protector
endif
CONFIGURE_VARS+= \
CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/avahi-{common,core} $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/avahi-core.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libavahi/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
endef
define Package/avahi-autoipd/install
$(INSTALL_DIR) $(1)/etc/avahi
$(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
endef
define Package/avahi-daemon/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/avahi
$(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
$(INSTALL_DIR) $(1)/etc/avahi/services
$(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
$(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
endef
define Package/avahi-dnsconfd/install
$(INSTALL_DIR) $(1)/etc/avahi
$(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,libavahi))
$(eval $(call BuildPackage,avahi-autoipd))
$(eval $(call BuildPackage,avahi-daemon))
$(eval $(call BuildPackage,avahi-dnsconfd))

View File

@ -1,164 +0,0 @@
10
dir
25991
svn://svn.openwrt.org/openwrt/packages/libs/avahi/files
svn://svn.openwrt.org/openwrt
2009-04-17T15:22:00.575847Z
15247
nico
3c298f89-4303-0410-b956-a3cf2f4a3e73
avahi-daemon.init
file
2010-07-24T18:00:01.268389Z
80c8607dfee5436effe2fb31ffe35368
2009-04-17T15:22:00.575847Z
15247
nico
has-props
267
service-ssh
file
2010-07-24T18:00:01.268389Z
2a3773d96969b121c3fa0988f9921b8c
2009-04-17T15:22:00.575847Z
15247
nico
has-props
265
avahi-daemon.conf
file
2010-07-24T18:00:01.272389Z
4e760dbb6d6c769316874acd7015537d
2009-04-17T15:22:00.575847Z
15247
nico
has-props
445
service-http
file
2010-07-24T18:00:01.272389Z
cad04c15d78baf565a4277f4dbbb4286
2009-04-17T15:22:00.575847Z
15247
nico
has-props
309

View File

@ -1,5 +0,0 @@
K 13
svn:eol-style
V 6
native
END

View File

@ -1,5 +0,0 @@
K 13
svn:eol-style
V 6
native
END

View File

@ -1,5 +0,0 @@
K 13
svn:eol-style
V 6
native
END

View File

@ -1,5 +0,0 @@
K 13
svn:eol-style
V 6
native
END

View File

@ -1,28 +0,0 @@
[server]
#host-name=foo
#domain-name=local
use-ipv4=yes
use-ipv6=no
check-response-ttl=no
use-iff-running=no
[publish]
publish-addresses=yes
publish-hinfo=yes
publish-workstation=no
publish-domain=yes
#publish-dns-servers=192.168.1.1
#publish-resolv-conf-dns-servers=yes
[reflector]
enable-reflector=no
reflect-ipv=no
[rlimits]
#rlimit-as=
rlimit-core=0
rlimit-data=4194304
rlimit-fsize=0
rlimit-nofile=30
rlimit-stack=4194304
rlimit-nproc=1

View File

@ -1,23 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
BIN=avahi-daemon
DEFAULT=/etc/default/$BIN
OPTIONS="-D"
RUN_D=/var/run/$BIN
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
$BIN -k
}
reload() {
$BIN -r
}

View File

@ -1,10 +0,0 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Web Server on %h</name>
<service>
<type>_http._tcp</type>
<port>80</port>
<txt-record>path=/index.html</txt-record>
</service>
</service-group>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Secure Shell on %h</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>

View File

@ -1,28 +0,0 @@
[server]
#host-name=foo
#domain-name=local
use-ipv4=yes
use-ipv6=no
check-response-ttl=no
use-iff-running=no
[publish]
publish-addresses=yes
publish-hinfo=yes
publish-workstation=no
publish-domain=yes
#publish-dns-servers=192.168.1.1
#publish-resolv-conf-dns-servers=yes
[reflector]
enable-reflector=no
reflect-ipv=no
[rlimits]
#rlimit-as=
rlimit-core=0
rlimit-data=4194304
rlimit-fsize=0
rlimit-nofile=30
rlimit-stack=4194304
rlimit-nproc=1

View File

@ -1,23 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
BIN=avahi-daemon
DEFAULT=/etc/default/$BIN
OPTIONS="-D"
RUN_D=/var/run/$BIN
start() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
$BIN $OPTIONS
}
stop() {
$BIN -k
}
reload() {
$BIN -r
}

View File

@ -1,10 +0,0 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Web Server on %h</name>
<service>
<type>_http._tcp</type>
<port>80</port>
<txt-record>path=/index.html</txt-record>
</service>
</service-group>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Secure Shell on %h</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>

View File

@ -1,62 +0,0 @@
10
dir
25991
svn://svn.openwrt.org/openwrt/packages/libs/avahi/patches
svn://svn.openwrt.org/openwrt
2011-03-09T12:34:25.840259Z
25973
jow
3c298f89-4303-0410-b956-a3cf2f4a3e73
010-step_back_autotools-no-gettext.patch
file
2011-03-10T08:41:40.076744Z
1fbd7df008628912218cd4f2cdf0e00c
2011-03-09T12:34:25.840259Z
25973
jow
1983

View File

@ -1,80 +0,0 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -75,8 +75,7 @@ SUBDIRS = \
avahi-compat-howl \
avahi-autoipd \
avahi-ui \
- avahi-ui-sharp \
- po
+ avahi-ui-sharp
DX_INPUT = \
$(srcdir)/avahi-common/address.h \
--- a/avahi-python/avahi-discover/Makefile.am
+++ b/avahi-python/avahi-discover/Makefile.am
@@ -38,7 +38,6 @@ if HAVE_GDBM
pythonscripts += \
avahi-discover
desktop_DATA += avahi-discover.desktop
-@INTLTOOL_DESKTOP_RULE@
avahi_discover_PYTHON += __init__.py
endif
@@ -46,7 +45,6 @@ if HAVE_DBM
pythonscripts += \
avahi-discover
desktop_DATA += avahi-discover.desktop
-@INTLTOOL_DESKTOP_RULE@
avahi_discover_PYTHON += __init__.py
endif
--- a/avahi-ui/Makefile.am
+++ b/avahi-ui/Makefile.am
@@ -78,7 +78,6 @@ endif
bin_PROGRAMS = bssh
desktop_DATA += bssh.desktop bvnc.desktop
-@INTLTOOL_DESKTOP_RULE@
bssh_SOURCES = bssh.c
@@ -106,6 +105,4 @@ endif # HAVE_GLIB
endif
endif
-@INTLTOOL_DESKTOP_RULE@
-
CLEANFILES = $(desktop_DATA) $(desktop_DATA_in)
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ AC_INIT([avahi],[0.6.29],[avahi (at) lis
AC_CONFIG_SRCDIR([avahi-core/server.c])
AC_CONFIG_MACRO_DIR([common])
AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
+AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability tar-pax])
AC_SUBST(PACKAGE_URL, [http://avahi.org/])
@@ -43,8 +43,6 @@ AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8])
AC_CANONICAL_HOST
-AM_SILENT_RULES([yes])
-
AC_CHECK_PROG([STOW], [stow], [yes], [no])
AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
@@ -412,12 +410,6 @@ if test "x$have_kqueue" = "xyes" ; then
AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
fi
-IT_PROG_INTLTOOL([0.35.0])
-GETTEXT_PACKAGE=avahi
-AC_SUBST([GETTEXT_PACKAGE])
-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
-AM_GLIB_GNU_GETTEXT
-
avahilocaledir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(avahilocaledir)

View File

@ -1,80 +0,0 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -75,8 +75,7 @@ SUBDIRS = \
avahi-compat-howl \
avahi-autoipd \
avahi-ui \
- avahi-ui-sharp \
- po
+ avahi-ui-sharp
DX_INPUT = \
$(srcdir)/avahi-common/address.h \
--- a/avahi-python/avahi-discover/Makefile.am
+++ b/avahi-python/avahi-discover/Makefile.am
@@ -38,7 +38,6 @@ if HAVE_GDBM
pythonscripts += \
avahi-discover
desktop_DATA += avahi-discover.desktop
-@INTLTOOL_DESKTOP_RULE@
avahi_discover_PYTHON += __init__.py
endif
@@ -46,7 +45,6 @@ if HAVE_DBM
pythonscripts += \
avahi-discover
desktop_DATA += avahi-discover.desktop
-@INTLTOOL_DESKTOP_RULE@
avahi_discover_PYTHON += __init__.py
endif
--- a/avahi-ui/Makefile.am
+++ b/avahi-ui/Makefile.am
@@ -78,7 +78,6 @@ endif
bin_PROGRAMS = bssh
desktop_DATA += bssh.desktop bvnc.desktop
-@INTLTOOL_DESKTOP_RULE@
bssh_SOURCES = bssh.c
@@ -106,6 +105,4 @@ endif # HAVE_GLIB
endif
endif
-@INTLTOOL_DESKTOP_RULE@
-
CLEANFILES = $(desktop_DATA) $(desktop_DATA_in)
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ AC_INIT([avahi],[0.6.29],[avahi (at) lis
AC_CONFIG_SRCDIR([avahi-core/server.c])
AC_CONFIG_MACRO_DIR([common])
AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
+AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability tar-pax])
AC_SUBST(PACKAGE_URL, [http://avahi.org/])
@@ -43,8 +43,6 @@ AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8])
AC_CANONICAL_HOST
-AM_SILENT_RULES([yes])
-
AC_CHECK_PROG([STOW], [stow], [yes], [no])
AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [
@@ -412,12 +410,6 @@ if test "x$have_kqueue" = "xyes" ; then
AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
fi
-IT_PROG_INTLTOOL([0.35.0])
-GETTEXT_PACKAGE=avahi
-AC_SUBST([GETTEXT_PACKAGE])
-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
-AM_GLIB_GNU_GETTEXT
-
avahilocaledir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(avahilocaledir)

View File

@ -1,58 +0,0 @@
#
# Copyright (C) 2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=avrdude
PKG_VERSION:=5.10
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/avrdude
PKG_MD5SUM:=69b082683047e054348088fd63bad2ff
include $(INCLUDE_DIR)/package.mk
define Package/avrdude
SECTION:=utils
CATEGORY:=Utilities
TITLE:=AVR Downloader/UploaDEr
URL:=http://www.bsdhome.com/avrdude/
DEPENDS:=@GPIO_SUPPORT +libncurses
endef
define Package/avrdude/description
AVRDUDE is a full featured program for programming Atmel's AVR CPU's.
endef
define Build/Prepare
$(call Build/Prepare/Default)
chmod -R u+w $(PKG_BUILD_DIR)
endef
CONFIGURE_ARGS+= \
--disable-parport \
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" CFLAGS="-I$(LINUX_DIR)/include"\
install-exec
endef
define Package/avrdude/conffiles
/etc/avrdude.conf
endef
define Package/avrdude/install
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/avrdude.conf $(1)/etc/
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/avrdude $(1)/usr/bin/
endef
$(eval $(call BuildPackage,avrdude))

View File

@ -1,389 +0,0 @@
diff -urNad /tmp/avrdude-5.10/avrdude.conf.in avrdude-5.10/avrdude.conf.in
--- /tmp/avrdude-5.10/avrdude.conf.in 2010-08-06 13:53:20.883965102 +0200
+++ avrdude-5.10/avrdude.conf.in 2010-08-06 13:11:12.803965267 +0200
@@ -833,6 +833,16 @@
miso = 8;
;
+programmer
+ id = "gpio";
+ desc = "Use gpio_dev to bitbang GPIO lines";
+ type = gpio;
+ reset = 0;
+ sck = 3;
+ mosi = 1;
+ miso = 2;
+;
+
# Same as above, different name
# reset=!txd sck=rts mosi=dtr miso=cts
diff -urNad /tmp/avrdude-5.10/config_gram.y avrdude-5.10/config_gram.y
--- /tmp/avrdude-5.10/config_gram.y 2010-08-06 13:53:20.891969681 +0200
+++ avrdude-5.10/config_gram.y 2010-08-06 13:11:12.827964827 +0200
@@ -39,6 +39,7 @@
#include "stk500.h"
#include "arduino.h"
#include "buspirate.h"
+#include "gpio.h"
#include "stk500v2.h"
#include "stk500generic.h"
#include "avr910.h"
@@ -99,6 +100,7 @@
%token K_DRAGON_JTAG
%token K_DRAGON_PDI
%token K_DRAGON_PP
+%token K_GPIO
%token K_STK500_DEVCODE
%token K_AVR910_DEVCODE
%token K_EEPROM
@@ -437,6 +439,12 @@
buspirate_initpgm(current_prog);
}
} |
+
+ K_TYPE TKN_EQUAL K_GPIO {
+ {
+ gpio_initpgm(current_prog);
+ }
+ } |
K_TYPE TKN_EQUAL K_STK600 {
{
diff -urNad /tmp/avrdude-5.10/gpio.c avrdude-5.10/gpio.c
--- /tmp/avrdude-5.10/gpio.c 1970-01-01 01:00:00.000000000 +0100
+++ avrdude-5.10/gpio.c 2010-08-06 13:11:12.823989322 +0200
@@ -0,0 +1,181 @@
+/*
+ * avrdude - A Downloader/Uploader for AVR device programmers
+ * Support for a bitbanged GPIO programmer using gpio_dev
+ *
+ * copyright (c) 2010 flukso.net
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "ac_cfg.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "avrdude.h"
+#include "avr.h"
+#include "pindefs.h"
+#include "pgm.h"
+#include "bitbang.h"
+
+#include <linux/gpio_dev.h>
+#include <sys/ioctl.h>
+
+#define AVRDUDE_GPIO_DIR_IN 0
+#define AVRDUDE_GPIO_DIR_OUT 1
+
+static int gpio_fd;
+
+static void _gpio_dir(int pin, int dir)
+{
+ pin &= PIN_MASK;
+
+ if (dir == AVRDUDE_GPIO_DIR_OUT)
+ ioctl(gpio_fd, GPIO_DIR_OUT, pin);
+ else
+ ioctl(gpio_fd, GPIO_DIR_IN, pin);
+
+ return;
+}
+
+static int gpio_setpin(PROGRAMMER * pgm, int pin, int value)
+{
+ if (pin & PIN_INVERSE) {
+ value = !value;
+ pin &= PIN_MASK;
+ }
+
+ if (value)
+ ioctl(gpio_fd, GPIO_SET, pin);
+ else
+ ioctl(gpio_fd, GPIO_CLEAR, pin);
+
+ if (pgm->ispdelay > 1)
+ bitbang_delay(pgm->ispdelay);
+
+ return 0;
+}
+
+static int gpio_getpin(PROGRAMMER * pgm, int pin)
+{
+ char input, inv = 0;
+
+ if (pin & PIN_INVERSE) {
+ inv = 1;
+ pin &= PIN_MASK;
+ }
+
+ input = ioctl(gpio_fd, GPIO_GET, pin);
+
+ if (inv) {
+ return input ^ 1;
+ }
+ else {
+ return input;
+ }
+}
+
+static int gpio_highpulsepin(PROGRAMMER * pgm, int pin)
+{
+ gpio_setpin(pgm, pin, 1);
+ gpio_setpin(pgm, pin, 0);
+
+ return 0;
+}
+
+
+
+static void gpio_display(PROGRAMMER *pgm, const char *p)
+{
+ /* nothing */
+}
+
+static void gpio_enable(PROGRAMMER *pgm)
+{
+ /* nothing */
+}
+
+static void gpio_disable(PROGRAMMER *pgm)
+{
+ /* nothing */
+}
+
+static void gpio_powerup(PROGRAMMER *pgm)
+{
+ /* nothing */
+}
+
+static void gpio_powerdown(PROGRAMMER *pgm)
+{
+ /* nothing */
+}
+
+static int gpio_open(PROGRAMMER *pgm, char *port)
+{
+ int i;
+
+ bitbang_check_prerequisites(pgm);
+
+ if ((gpio_fd = open("/dev/gpio", O_RDWR)) < 0) {
+ perror("cannot open /dev/gpio");
+ return -1;
+ }
+
+ for (i = 0; i < N_PINS; i++) {
+ if (i == PIN_AVR_MISO)
+ _gpio_dir(pgm->pinno[i], AVRDUDE_GPIO_DIR_IN);
+ else
+ _gpio_dir(pgm->pinno[i], AVRDUDE_GPIO_DIR_OUT);
+ }
+
+ return(0);
+}
+
+static void gpio_close(PROGRAMMER *pgm)
+{
+ gpio_setpin(pgm, pgm->pinno[PIN_AVR_RESET], 1);
+ close(gpio_fd);
+ return;
+}
+
+void gpio_initpgm(PROGRAMMER *pgm)
+{
+ strcpy(pgm->type, "GPIO");
+
+ pgm->rdy_led = bitbang_rdy_led;
+ pgm->err_led = bitbang_err_led;
+ pgm->pgm_led = bitbang_pgm_led;
+ pgm->vfy_led = bitbang_vfy_led;
+ pgm->initialize = bitbang_initialize;
+ pgm->display = gpio_display;
+ pgm->enable = gpio_enable;
+ pgm->disable = gpio_disable;
+ pgm->powerup = gpio_powerup;
+ pgm->powerdown = gpio_powerdown;
+ pgm->program_enable = bitbang_program_enable;
+ pgm->chip_erase = bitbang_chip_erase;
+ pgm->cmd = bitbang_cmd;
+ pgm->open = gpio_open;
+ pgm->close = gpio_close;
+ pgm->setpin = gpio_setpin;
+ pgm->getpin = gpio_getpin;
+ pgm->highpulsepin = gpio_highpulsepin;
+ pgm->read_byte = avr_read_byte_default;
+ pgm->write_byte = avr_write_byte_default;
+}
diff -urNad /tmp/avrdude-5.10/gpio.h avrdude-5.10/gpio.h
--- /tmp/avrdude-5.10/gpio.h 1970-01-01 01:00:00.000000000 +0100
+++ avrdude-5.10/gpio.h 2010-08-06 13:37:40.479767917 +0200
@@ -0,0 +1,33 @@
+/*
+ * avrdude - A Downloader/Uploader for AVR device programmers
+ * Copyright (C) 2000-2004 Brian S. Dean <b...@bsdhome.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef gpio_h
+#define gpio_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void gpio_initpgm (PROGRAMMER * pgm);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff -urNad /tmp/avrdude-5.10/lexer.l avrdude-5.10/lexer.l
--- /tmp/avrdude-5.10/lexer.l 2010-08-06 13:53:20.883965102 +0200
+++ avrdude-5.10/lexer.l 2010-08-06 13:11:12.803965267 +0200
@@ -146,6 +146,7 @@
enablepageprogramming { yylval=NULL; return K_ENABLEPAGEPROGRAMMING; }
errled { yylval=NULL; return K_ERRLED; }
flash { yylval=NULL; return K_FLASH; }
+gpio { yylval=NULL; return K_GPIO; }
has_jtag { yylval=NULL; return K_HAS_JTAG; }
has_debugwire { yylval=NULL; return K_HAS_DW; }
has_pdi { yylval=NULL; return K_HAS_PDI; }
diff -urNad /tmp/avrdude-5.10/Makefile.am avrdude-5.10/Makefile.am
--- /tmp/avrdude-5.10/Makefile.am 2010-08-06 13:53:20.891969681 +0200
+++ avrdude-5.10/Makefile.am 2010-08-06 13:11:12.827964827 +0200
@@ -101,6 +101,8 @@
fileio.c \
fileio.h \
freebsd_ppi.h \
+ gpio.c \
+ gpio.h \
jtagmkI.c \
jtagmkI.h \
jtagmkI_private.h \
diff -urNad /tmp/avrdude-5.10/Makefile.in avrdude-5.10/Makefile.in
--- /tmp/avrdude-5.10/Makefile.in 2010-08-06 13:53:20.887965471 +0200
+++ avrdude-5.10/Makefile.in 2010-08-06 13:11:12.811964888 +0200
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -87,11 +87,11 @@
libavrdude_a-buspirate.$(OBJEXT) \
libavrdude_a-butterfly.$(OBJEXT) libavrdude_a-config.$(OBJEXT) \
libavrdude_a-confwin.$(OBJEXT) libavrdude_a-crc16.$(OBJEXT) \
- libavrdude_a-fileio.$(OBJEXT) libavrdude_a-jtagmkI.$(OBJEXT) \
- libavrdude_a-jtagmkII.$(OBJEXT) libavrdude_a-lists.$(OBJEXT) \
- libavrdude_a-par.$(OBJEXT) libavrdude_a-pgm.$(OBJEXT) \
- libavrdude_a-ppi.$(OBJEXT) libavrdude_a-ppiwin.$(OBJEXT) \
- libavrdude_a-safemode.$(OBJEXT) \
+ libavrdude_a-fileio.$(OBJEXT) libavrdude_a-gpio.$(OBJEXT) \
+ libavrdude_a-jtagmkI.$(OBJEXT) libavrdude_a-jtagmkII.$(OBJEXT) \
+ libavrdude_a-lists.$(OBJEXT) libavrdude_a-par.$(OBJEXT) \
+ libavrdude_a-pgm.$(OBJEXT) libavrdude_a-ppi.$(OBJEXT) \
+ libavrdude_a-ppiwin.$(OBJEXT) libavrdude_a-safemode.$(OBJEXT) \
libavrdude_a-serbb_posix.$(OBJEXT) \
libavrdude_a-serbb_win32.$(OBJEXT) \
libavrdude_a-ser_avrdoper.$(OBJEXT) \
@@ -204,6 +204,7 @@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
@@ -323,6 +324,8 @@
fileio.c \
fileio.h \
freebsd_ppi.h \
+ gpio.c \
+ gpio.h \
jtagmkI.c \
jtagmkI.h \
jtagmkI_private.h \
@@ -493,6 +496,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libavrdude_a-confwin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libavrdude_a-crc16.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libavrdude_a-fileio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libavrdude_a-gpio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libavrdude_a-jtagmkI.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libavrdude_a-jtagmkII.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libavrdude_a-lexer.Po@am__quote@
@@ -711,6 +715,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavrdude_a_CPPFLAGS) $(CPPFLAGS) $(libavrdude_a_CFLAGS) $(CFLAGS) -c -o libavrdude_a-fileio.obj `if test -f 'fileio.c'; then $(CYGPATH_W) 'fileio.c'; else $(CYGPATH_W) '$(srcdir)/fileio.c'; fi`
+libavrdude_a-gpio.o: gpio.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavrdude_a_CPPFLAGS) $(CPPFLAGS) $(libavrdude_a_CFLAGS) $(CFLAGS) -MT libavrdude_a-gpio.o -MD -MP -MF $(DEPDIR)/libavrdude_a-gpio.Tpo -c -o libavrdude_a-gpio.o `test -f 'gpio.c' || echo '$(srcdir)/'`gpio.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libavrdude_a-gpio.Tpo $(DEPDIR)/libavrdude_a-gpio.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gpio.c' object='libavrdude_a-gpio.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavrdude_a_CPPFLAGS) $(CPPFLAGS) $(libavrdude_a_CFLAGS) $(CFLAGS) -c -o libavrdude_a-gpio.o `test -f 'gpio.c' || echo '$(srcdir)/'`gpio.c
+
+libavrdude_a-gpio.obj: gpio.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavrdude_a_CPPFLAGS) $(CPPFLAGS) $(libavrdude_a_CFLAGS) $(CFLAGS) -MT libavrdude_a-gpio.obj -MD -MP -MF $(DEPDIR)/libavrdude_a-gpio.Tpo -c -o libavrdude_a-gpio.obj `if test -f 'gpio.c'; then $(CYGPATH_W) 'gpio.c'; else $(CYGPATH_W) '$(srcdir)/gpio.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libavrdude_a-gpio.Tpo $(DEPDIR)/libavrdude_a-gpio.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gpio.c' object='libavrdude_a-gpio.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavrdude_a_CPPFLAGS) $(CPPFLAGS) $(libavrdude_a_CFLAGS) $(CFLAGS) -c -o libavrdude_a-gpio.obj `if test -f 'gpio.c'; then $(CYGPATH_W) 'gpio.c'; else $(CYGPATH_W) '$(srcdir)/gpio.c'; fi`
+
libavrdude_a-jtagmkI.o: jtagmkI.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libavrdude_a_CPPFLAGS) $(CPPFLAGS) $(libavrdude_a_CFLAGS) $(CFLAGS) -MT libavrdude_a-jtagmkI.o -MD -MP -MF $(DEPDIR)/libavrdude_a-jtagmkI.Tpo -c -o libavrdude_a-jtagmkI.o `test -f 'jtagmkI.c' || echo '$(srcdir)/'`jtagmkI.c
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libavrdude_a-jtagmkI.Tpo $(DEPDIR)/libavrdude_a-jtagmkI.Po
@@ -1035,8 +1053,8 @@
esac; \
done; \
for i in $$list; do \
- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
- else file=$$i; fi; \
+ if test -f $$i; then file=$$i; \
+ else file=$(srcdir)/$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
@@ -1162,7 +1180,7 @@
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS

View File

@ -1,771 +0,0 @@
diff -urNad /tmp/avrdude-5.10/config_gram.y avrdude-5.10/config_gram.y
--- /tmp/avrdude-5.10/config_gram.y 2010-08-06 20:32:45.039034875 +0200
+++ avrdude-5.10/config_gram.y 2010-08-06 20:30:54.071034545 +0200
@@ -386,179 +386,12 @@
}
} |
- K_TYPE TKN_EQUAL K_PAR {
- {
- par_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_SERBB {
- {
- serbb_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_STK500 {
- {
- stk500_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_STK500V2 {
- {
- stk500v2_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_STK500HVSP {
- {
- stk500hvsp_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_STK500PP {
- {
- stk500pp_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_STK500GENERIC {
- {
- stk500generic_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_ARDUINO {
- {
- arduino_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_BUSPIRATE {
- {
- buspirate_initpgm(current_prog);
- }
- } |
-
K_TYPE TKN_EQUAL K_GPIO {
{
gpio_initpgm(current_prog);
}
} |
- K_TYPE TKN_EQUAL K_STK600 {
- {
- stk600_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_STK600HVSP {
- {
- stk600hvsp_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_STK600PP {
- {
- stk600pp_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_AVR910 {
- {
- avr910_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_USBASP {
- {
- usbasp_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_USBTINY {
- {
- usbtiny_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_BUTTERFLY {
- {
- butterfly_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_JTAG_MKI {
- {
- jtagmkI_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_JTAG_MKII {
- {
- jtagmkII_initpgm(current_prog);
- }
- } |
- K_TYPE TKN_EQUAL K_JTAG_MKII_AVR32 {
- {
- jtagmkII_avr32_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_JTAG_MKII_DW {
- {
- jtagmkII_dw_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_JTAG_MKII_ISP {
- {
- stk500v2_jtagmkII_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_JTAG_MKII_PDI {
- {
- jtagmkII_pdi_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_DRAGON_DW {
- {
- jtagmkII_dragon_dw_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_DRAGON_HVSP {
- {
- stk500v2_dragon_hvsp_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_DRAGON_ISP {
- {
- stk500v2_dragon_isp_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_DRAGON_JTAG {
- {
- jtagmkII_dragon_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_DRAGON_PDI {
- {
- jtagmkII_dragon_pdi_initpgm(current_prog);
- }
- } |
-
- K_TYPE TKN_EQUAL K_DRAGON_PP {
- {
- stk500v2_dragon_pp_initpgm(current_prog);
- }
- } |
-
K_DESC TKN_EQUAL TKN_STRING {
strncpy(current_prog->desc, $3->value.string, PGM_DESCLEN);
current_prog->desc[PGM_DESCLEN-1] = 0;
diff -urNad /tmp/avrdude-5.10/avrdude.conf.in avrdude-5.10/avrdude.conf.in
--- /tmp/avrdude-5.10/avrdude.conf.in 2010-08-06 20:28:58.959965749 +0200
+++ avrdude-5.10/avrdude.conf.in 2010-08-06 20:44:19.466964893 +0200
@@ -315,525 +315,6 @@
#
programmer
- id = "arduino";
- desc = "Arduino";
- type = arduino;
-;
-
-programmer
- id = "avrisp";
- desc = "Atmel AVR ISP";
- type = stk500;
-;
-
-programmer
- id = "avrispv2";
- desc = "Atmel AVR ISP V2";
- type = stk500v2;
-;
-
-programmer
- id = "avrispmkII";
- desc = "Atmel AVR ISP mkII";
- type = stk500v2;
-;
-
-programmer
- id = "avrisp2";
- desc = "Atmel AVR ISP mkII";
- type = stk500v2;
-;
-
-programmer
- id = "buspirate";
- desc = "The Bus Pirate";
- type = buspirate;
-;
-
-# This is supposed to be the "default" STK500 entry.
-# Attempts to select the correct firmware version
-# by probing for it. Better use one of the entries
-# below instead.
-programmer
- id = "stk500";
- desc = "Atmel STK500";
- type = stk500generic;
-;
-
-programmer
- id = "stk500v1";
- desc = "Atmel STK500 Version 1.x firmware";
- type = stk500;
-;
-
-programmer
- id = "mib510";
- desc = "Crossbow MIB510 programming board";
- type = stk500;
-;
-
-programmer
- id = "stk500v2";
- desc = "Atmel STK500 Version 2.x firmware";
- type = stk500v2;
-;
-
-programmer
- id = "stk500pp";
- desc = "Atmel STK500 V2 in parallel programming mode";
- type = stk500pp;
-;
-
-programmer
- id = "stk500hvsp";
- desc = "Atmel STK500 V2 in high-voltage serial programming mode";
- type = stk500hvsp;
-;
-
-programmer
- id = "stk600";
- desc = "Atmel STK600";
- type = stk600;
-;
-
-programmer
- id = "stk600pp";
- desc = "Atmel STK600 in parallel programming mode";
- type = stk600pp;
-;
-
-programmer
- id = "stk600hvsp";
- desc = "Atmel STK600 in high-voltage serial programming mode";
- type = stk600hvsp;
-;
-
-programmer
- id = "avr910";
- desc = "Atmel Low Cost Serial Programmer";
- type = avr910;
-;
-
-programmer
- id = "usbasp";
- desc = "USBasp, http://www.fischl.de/usbasp/";
- type = usbasp;
-;
-
-programmer
- id = "usbtiny";
- desc = "USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/";
- type = usbtiny;
-;
-
-programmer
- id = "butterfly";
- desc = "Atmel Butterfly Development Board";
- type = butterfly;
-;
-
-programmer
- id = "avr109";
- desc = "Atmel AppNote AVR109 Boot Loader";
- type = butterfly;
-;
-
-programmer
- id = "avr911";
- desc = "Atmel AppNote AVR911 AVROSP";
- type = butterfly;
-;
-
-programmer
- id = "jtagmkI";
- desc = "Atmel JTAG ICE (mkI)";
- baudrate = 115200; # default is 115200
- type = jtagmki;
-;
-
-# easier to type
-programmer
- id = "jtag1";
- desc = "Atmel JTAG ICE (mkI)";
- baudrate = 115200; # default is 115200
- type = jtagmki;
-;
-
-# easier to type
-programmer
- id = "jtag1slow";
- desc = "Atmel JTAG ICE (mkI)";
- baudrate = 19200;
- type = jtagmki;
-;
-
-programmer
- id = "jtagmkII";
- desc = "Atmel JTAG ICE mkII";
- baudrate = 19200; # default is 19200
- type = jtagmkii;
-;
-
-# easier to type
-programmer
- id = "jtag2slow";
- desc = "Atmel JTAG ICE mkII";
- baudrate = 19200; # default is 19200
- type = jtagmkii;
-;
-
-# JTAG ICE mkII @ 115200 Bd
-programmer
- id = "jtag2fast";
- desc = "Atmel JTAG ICE mkII";
- baudrate = 115200;
- type = jtagmkii;
-;
-
-# make the fast one the default, people will love that
-programmer
- id = "jtag2";
- desc = "Atmel JTAG ICE mkII";
- baudrate = 115200;
- type = jtagmkii;
-;
-
-# JTAG ICE mkII in ISP mode
-programmer
- id = "jtag2isp";
- desc = "Atmel JTAG ICE mkII in ISP mode";
- baudrate = 115200;
- type = jtagmkii_isp;
-;
-
-# JTAG ICE mkII in debugWire mode
-programmer
- id = "jtag2dw";
- desc = "Atmel JTAG ICE mkII in debugWire mode";
- baudrate = 115200;
- type = jtagmkii_dw;
-;
-
-# JTAG ICE mkII in AVR32 mode
-programmer
- id = "jtagmkII_avr32";
- desc = "Atmel JTAG ICE mkII im AVR32 mode";
- baudrate = 115200;
- type = jtagmkii_avr32;
-;
-
-# JTAG ICE mkII in AVR32 mode
-programmer
- id = "jtag2avr32";
- desc = "Atmel JTAG ICE mkII im AVR32 mode";
- baudrate = 115200;
- type = jtagmkii_avr32;
-;
-
-# JTAG ICE mkII in PDI mode
-programmer
- id = "jtag2pdi";
- desc = "Atmel JTAG ICE mkII PDI mode";
- baudrate = 115200;
- type = jtagmkii_pdi;
-;
-
-# AVR Dragon in JTAG mode
-programmer
- id = "dragon_jtag";
- desc = "Atmel AVR Dragon in JTAG mode";
- baudrate = 115200;
- type = dragon_jtag;
-;
-
-# AVR Dragon in ISP mode
-programmer
- id = "dragon_isp";
- desc = "Atmel AVR Dragon in ISP mode";
- baudrate = 115200;
- type = dragon_isp;
-;
-
-# AVR Dragon in PP mode
-programmer
- id = "dragon_pp";
- desc = "Atmel AVR Dragon in PP mode";
- baudrate = 115200;
- type = dragon_pp;
-;
-
-# AVR Dragon in HVSP mode
-programmer
- id = "dragon_hvsp";
- desc = "Atmel AVR Dragon in HVSP mode";
- baudrate = 115200;
- type = dragon_hvsp;
-;
-
-# AVR Dragon in debugWire mode
-programmer
- id = "dragon_dw";
- desc = "Atmel AVR Dragon in debugWire mode";
- baudrate = 115200;
- type = dragon_dw;
-;
-
-# AVR Dragon in PDI mode
-programmer
- id = "dragon_pdi";
- desc = "Atmel AVR Dragon in PDI mode";
- baudrate = 115200;
- type = dragon_pdi;
-;
-
-programmer
- id = "pavr";
- desc = "Jason Kyle's pAVR Serial Programmer";
- type = avr910;
-;
-
-@HAVE_PARPORT_BEGIN@ Inclusion of the following depends on --enable-parport
-# Parallel port programmers.
-
-programmer
- id = "bsd";
- desc = "Brian Dean's Programmer, http://www.bsdhome.com/avrdude/";
- type = par;
- vcc = 2, 3, 4, 5;
- reset = 7;
- sck = 8;
- mosi = 9;
- miso = 10;
-;
-
-programmer
- id = "stk200";
- desc = "STK200";
- type = par;
- buff = 4, 5;
- sck = 6;
- mosi = 7;
- reset = 9;
- miso = 10;
-;
-
-# The programming dongle used by the popular Ponyprog
-# utility. It is almost similar to the STK200 one,
-# except that there is a LED indicating that the
-# programming is currently in progress.
-
-programmer
- id = "pony-stk200";
- desc = "Pony Prog STK200";
- type = par;
- buff = 4, 5;
- sck = 6;
- mosi = 7;
- reset = 9;
- miso = 10;
- pgmled = 8;
-;
-
-programmer
- id = "dt006";
- desc = "Dontronics DT006";
- type = par;
- reset = 4;
- sck = 5;
- mosi = 2;
- miso = 11;
-;
-
-programmer
- id = "bascom";
- desc = "Bascom SAMPLE programming cable";
- type = par;
- reset = 4;
- sck = 5;
- mosi = 2;
- miso = 11;
-;
-
-programmer
- id = "alf";
- desc = "Nightshade ALF-PgmAVR, http://nightshade.homeip.net/";
- type = par;
- vcc = 2, 3, 4, 5;
- buff = 6;
- reset = 7;
- sck = 8;
- mosi = 9;
- miso = 10;
- errled = 1;
- rdyled = 14;
- pgmled = 16;
- vfyled = 17;
-;
-
-programmer
- id = "sp12";
- desc = "Steve Bolt's Programmer";
- type = par;
- vcc = 4,5,6,7,8;
- reset = 3;
- sck = 2;
- mosi = 9;
- miso = 11;
-;
-
-programmer
- id = "picoweb";
- desc = "Picoweb Programming Cable, http://www.picoweb.net/";
- type = par;
- reset = 2;
- sck = 3;
- mosi = 4;
- miso = 13;
-;
-
-programmer
- id = "abcmini";
- desc = "ABCmini Board, aka Dick Smith HOTCHIP";
- type = par;
- reset = 4;
- sck = 3;
- mosi = 2;
- miso = 10;
-;
-
-programmer
- id = "futurlec";
- desc = "Futurlec.com programming cable.";
- type = par;
- reset = 3;
- sck = 2;
- mosi = 1;
- miso = 10;
-;
-
-
-# From the contributor of the "xil" jtag cable:
-# The "vcc" definition isn't really vcc (the cable gets its power from
-# the programming circuit) but is necessary to switch one of the
-# buffer lines (trying to add it to the "buff" lines doesn't work).
-# With this, TMS connects to RESET, TDI to MOSI, TDO to MISO and TCK
-# to SCK (plus vcc/gnd of course)
-programmer
- id = "xil";
- desc = "Xilinx JTAG cable";
- type = par;
- mosi = 2;
- sck = 3;
- reset = 4;
- buff = 5;
- miso = 13;
- vcc = 6;
-;
-
-
-programmer
- id = "dapa";
- desc = "Direct AVR Parallel Access cable";
- type = par;
- vcc = 3;
- reset = 16;
- sck = 1;
- mosi = 2;
- miso = 11;
-;
-
-programmer
- id = "atisp";
- desc = "AT-ISP V1.1 programming cable for AVR-SDK1 from <http://micro-research.co.th/> micro-research.co.th";
- type = par;
- reset = ~6;
- sck = ~8;
- mosi = ~7;
- miso = ~10;
-;
-
-programmer
- id = "ere-isp-avr";
- desc = "ERE ISP-AVR <http://www.ere.co.th/download/sch050713.pdf>";
- type = par;
- reset = ~4;
- sck = 3;
- mosi = 2;
- miso = 10;
-;
-
-programmer
- id = "blaster";
- desc = "Altera ByteBlaster";
- type = par;
- sck = 2;
- miso = 11;
- reset = 3;
- mosi = 8;
- buff = 14;
-;
-
-# It is almost same as pony-stk200, except vcc on pin 5 to auto
-# disconnect port (download on http://electropol.free.fr)
-programmer
- id = "frank-stk200";
- desc = "Frank STK200";
- type = par;
- vcc = 5;
- sck = 6;
- mosi = 7;
- reset = 9;
- miso = 10;
- pgmled = 8;
-;
-
-# The AT98ISP Cable is a simple parallel dongle for AT89 family.
-# http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2877
-programmer
-id = "89isp";
-desc = "Atmel at89isp cable";
-type = par;
-reset = 17;
-sck = 1;
-mosi = 2;
-miso = 10;
-;
-
-@HAVE_PARPORT_END@
-
-#
-# some ultra cheap programmers use bitbanging on the
-# serialport.
-#
-# PC - DB9 - Pins for RS232:
-#
-# GND 5 -- |O
-# | O| <- 9 RI
-# DTR 4 <- |O |
-# | O| <- 8 CTS
-# TXD 3 <- |O |
-# | O| -> 7 RTS
-# RXD 2 -> |O |
-# | O| <- 6 DSR
-# DCD 1 -> |O
-#
-# Using RXD is currently not supported.
-# Using RI is not supported under Win32 but is supported under Posix.
-
-# serial ponyprog design (dasa2 in uisp)
-# reset=!txd sck=rts mosi=dtr miso=cts
-
-programmer
- id = "ponyser";
- desc = "design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts";
- type = serbb;
- reset = ~3;
- sck = 7;
- mosi = 4;
- miso = 8;
-;
-
-programmer
id = "gpio";
desc = "Use gpio_dev to bitbang GPIO lines";
type = gpio;
@@ -843,58 +324,6 @@
miso = 1;
;
-# Same as above, different name
-# reset=!txd sck=rts mosi=dtr miso=cts
-
-programmer
- id = "siprog";
- desc = "Lancos SI-Prog <http://www.lancos.com/siprogsch.html>";
- type = serbb;
- reset = ~3;
- sck = 7;
- mosi = 4;
- miso = 8;
-;
-
-# unknown (dasa in uisp)
-# reset=rts sck=dtr mosi=txd miso=cts
-
-programmer
- id = "dasa";
- desc = "serial port banging, reset=rts sck=dtr mosi=txd miso=cts";
- type = serbb;
- reset = 7;
- sck = 4;
- mosi = 3;
- miso = 8;
-;
-
-# unknown (dasa3 in uisp)
-# reset=!dtr sck=rts mosi=txd miso=cts
-
-programmer
- id = "dasa3";
- desc = "serial port banging, reset=!dtr sck=rts mosi=txd miso=cts";
- type = serbb;
- reset = ~4;
- sck = 7;
- mosi = 3;
- miso = 8;
-;
-
-# C2N232i (jumper configuration "auto")
-# reset=dtr sck=!rts mosi=!txd miso=!cts
-
-programmer
- id = "c2n232i";
- desc = "serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts";
- type = serbb;
- reset = 4;
- sck = ~7;
- mosi = ~3;
- miso = ~8;
-;
-
#
# PART DEFINITIONS
#

View File

@ -1,95 +0,0 @@
--- avrdude-5.10/config_gram.y.orig 2010-11-05 11:01:14.895247246 +0100
+++ avrdude-5.10/config_gram.y 2010-11-05 11:02:15.219259178 +0100
@@ -1212,10 +1212,10 @@
value = v->value.number;
- if ((value <= 0) || (value >= 18)) {
+ if ((value < 0) || (value >= 18)) {
fprintf(stderr,
"%s: error at line %d of %s: pin must be in the "
- "range 1-17\n",
+ "range 0-17\n",
progname, lineno, infile);
exit(1);
}
--- avrdude-5.10/gpio.c.orig 2010-11-05 20:46:03.363248072 +0100
+++ avrdude-5.10/gpio.c 2010-11-05 20:46:10.051256461 +0100
@@ -101,6 +101,26 @@
+static int gpio_rdy_led(PROGRAMMER * pgm, int value)
+{
+ /* nothing */
+}
+
+static int gpio_err_led(PROGRAMMER * pgm, int value)
+{
+ /* nothing */
+}
+
+static int gpio_pgm_led(PROGRAMMER * pgm, int value)
+{
+ /* nothing */
+}
+
+static int gpio_vfy_led(PROGRAMMER * pgm, int value)
+{
+ /* nothing */
+}
+
static void gpio_display(PROGRAMMER *pgm, const char *p)
{
/* nothing */
@@ -128,40 +148,34 @@
static int gpio_open(PROGRAMMER *pgm, char *port)
{
- int i;
-
- bitbang_check_prerequisites(pgm);
-
if ((gpio_fd = open("/dev/gpio", O_RDWR)) < 0) {
perror("cannot open /dev/gpio");
return -1;
}
- for (i = 0; i < N_PINS; i++) {
- if (i == PIN_AVR_MISO)
- _gpio_dir(pgm->pinno[i], AVRDUDE_GPIO_DIR_IN);
- else
- _gpio_dir(pgm->pinno[i], AVRDUDE_GPIO_DIR_OUT);
- }
+ _gpio_dir(pgm->pinno[PIN_AVR_RESET], AVRDUDE_GPIO_DIR_OUT);
+ _gpio_dir(pgm->pinno[PIN_AVR_SCK], AVRDUDE_GPIO_DIR_OUT);
+ _gpio_dir(pgm->pinno[PIN_AVR_MOSI], AVRDUDE_GPIO_DIR_OUT);
+ _gpio_dir(pgm->pinno[PIN_AVR_MISO], AVRDUDE_GPIO_DIR_IN);
- return(0);
+ return 0;
}
static void gpio_close(PROGRAMMER *pgm)
{
gpio_setpin(pgm, pgm->pinno[PIN_AVR_RESET], 1);
close(gpio_fd);
- return;
+ return 0;
}
void gpio_initpgm(PROGRAMMER *pgm)
{
strcpy(pgm->type, "GPIO");
- pgm->rdy_led = bitbang_rdy_led;
- pgm->err_led = bitbang_err_led;
- pgm->pgm_led = bitbang_pgm_led;
- pgm->vfy_led = bitbang_vfy_led;
+ pgm->rdy_led = gpio_rdy_led;
+ pgm->err_led = gpio_err_led;
+ pgm->pgm_led = gpio_pgm_led;
+ pgm->vfy_led = gpio_vfy_led;
pgm->initialize = bitbang_initialize;
pgm->display = gpio_display;
pgm->enable = gpio_enable;

View File

@ -1,197 +0,0 @@
--- /tmp/avrdude-5.10/avrdude.conf.in 2011-01-31 22:17:05.060017389 +0100
+++ avrdude-5.10/avrdude.conf.in 2011-01-31 22:22:03.792017389 +0100
@@ -4772,6 +4772,194 @@
;
#------------------------------------------------------------
+# ATmega168P
+#------------------------------------------------------------
+
+part
+ id = "m168p";
+ desc = "ATMEGA168P";
+ has_debugwire = yes;
+ flash_instr = 0xB6, 0x01, 0x11;
+ eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
+ 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
+ 0x99, 0xF9, 0xBB, 0xAF;
+ stk500_devcode = 0x86;
+ # avr910_devcode = 0x;
+ signature = 0x1e 0x94 0x0b;
+ pagel = 0xd7;
+ bs2 = 0xc2;
+ chip_erase_delay = 9000;
+ pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
+ "x x x x x x x x x x x x x x x x";
+
+ chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
+ "x x x x x x x x x x x x x x x x";
+
+ timeout = 200;
+ stabdelay = 100;
+ cmdexedelay = 25;
+ synchloops = 32;
+ bytedelay = 0;
+ pollindex = 3;
+ pollvalue = 0x53;
+ predelay = 1;
+ postdelay = 1;
+ pollmethod = 1;
+
+ pp_controlstack =
+ 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
+ 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
+ 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
+ 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00;
+ hventerstabdelay = 100;
+ progmodedelay = 0;
+ latchcycles = 5;
+ togglevtg = 1;
+ poweroffdelay = 15;
+ resetdelayms = 1;
+ resetdelayus = 0;
+ hvleavestabdelay = 15;
+ resetdelay = 15;
+ chiperasepulsewidth = 0;
+ chiperasepolltimeout = 10;
+ programfusepulsewidth = 0;
+ programfusepolltimeout = 5;
+ programlockpulsewidth = 0;
+ programlockpolltimeout = 5;
+
+ memory "eeprom"
+ paged = no;
+ page_size = 4;
+ size = 512;
+ min_write_delay = 3600;
+ max_write_delay = 3600;
+ readback_p1 = 0xff;
+ readback_p2 = 0xff;
+ read = " 1 0 1 0 0 0 0 0",
+ " 0 0 0 x x x x a8",
+ " a7 a6 a5 a4 a3 a2 a1 a0",
+ " o o o o o o o o";
+
+ write = " 1 1 0 0 0 0 0 0",
+ " 0 0 0 x x x x a8",
+ " a7 a6 a5 a4 a3 a2 a1 a0",
+ " i i i i i i i i";
+
+ loadpage_lo = " 1 1 0 0 0 0 0 1",
+ " 0 0 0 0 0 0 0 0",
+ " 0 0 0 0 0 0 a1 a0",
+ " i i i i i i i i";
+
+ writepage = " 1 1 0 0 0 0 1 0",
+ " 0 0 x x x x x a8",
+ " a7 a6 a5 a4 a3 a2 0 0",
+ " x x x x x x x x";
+
+ mode = 0x41;
+ delay = 5;
+ blocksize = 4;
+ readsize = 256;
+ ;
+
+ memory "flash"
+ paged = yes;
+ size = 16384;
+ page_size = 128;
+ num_pages = 128;
+ min_write_delay = 4500;
+ max_write_delay = 4500;
+ readback_p1 = 0xff;
+ readback_p2 = 0xff;
+ read_lo = " 0 0 1 0 0 0 0 0",
+ " 0 0 0 a12 a11 a10 a9 a8",
+ " a7 a6 a5 a4 a3 a2 a1 a0",
+ " o o o o o o o o";
+
+ read_hi = " 0 0 1 0 1 0 0 0",
+ " 0 0 0 a12 a11 a10 a9 a8",
+ " a7 a6 a5 a4 a3 a2 a1 a0",
+ " o o o o o o o o";
+
+ loadpage_lo = " 0 1 0 0 0 0 0 0",
+ " 0 0 0 x x x x x",
+ " x x a5 a4 a3 a2 a1 a0",
+ " i i i i i i i i";
+
+ loadpage_hi = " 0 1 0 0 1 0 0 0",
+ " 0 0 0 x x x x x",
+ " x x a5 a4 a3 a2 a1 a0",
+ " i i i i i i i i";
+
+ writepage = " 0 1 0 0 1 1 0 0",
+ " 0 0 0 a12 a11 a10 a9 a8",
+ " a7 a6 x x x x x x",
+ " x x x x x x x x";
+
+ mode = 0x41;
+ delay = 6;
+ blocksize = 128;
+ readsize = 256;
+
+ ;
+
+ memory "lfuse"
+ size = 1;
+ min_write_delay = 4500;
+ max_write_delay = 4500;
+ read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0",
+ "x x x x x x x x o o o o o o o o";
+
+ write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
+ "x x x x x x x x i i i i i i i i";
+ ;
+
+ memory "hfuse"
+ size = 1;
+ min_write_delay = 4500;
+ max_write_delay = 4500;
+ read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0",
+ "x x x x x x x x o o o o o o o o";
+
+ write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0",
+ "x x x x x x x x i i i i i i i i";
+ ;
+
+ memory "efuse"
+ size = 1;
+ min_write_delay = 4500;
+ max_write_delay = 4500;
+ read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
+ "x x x x x x x x x x x x x o o o";
+
+ write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
+ "x x x x x x x x x x x x x i i i";
+ ;
+
+ memory "lock"
+ size = 1;
+ min_write_delay = 4500;
+ max_write_delay = 4500;
+ read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0",
+ "x x x x x x x x x x o o o o o o";
+
+ write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x",
+ "x x x x x x x x 1 1 i i i i i i";
+ ;
+
+ memory "calibration"
+ size = 1;
+ read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x",
+ "0 0 0 0 0 0 0 0 o o o o o o o o";
+ ;
+
+ memory "signature"
+ size = 3;
+ read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x",
+ "x x x x x x a1 a0 o o o o o o o o";
+ ;
+;
+
+#------------------------------------------------------------
# ATmega328P
#------------------------------------------------------------

View File

@ -1,13 +0,0 @@
--- /tmp/avrdude-5.10/avrdude.conf.in 2011-01-31 22:40:13.496017390 +0100
+++ avrdude-5.10/avrdude.conf.in 2011-01-31 22:41:05.824017388 +0100
@@ -318,8 +318,8 @@
id = "gpio";
desc = "Use gpio_dev to bitbang GPIO lines";
type = gpio;
- reset = 0;
- sck = 3;
+ reset = ~0;
+ sck = ~3;
mosi = 1;
miso = 2;
;

View File

@ -1,38 +0,0 @@
# Copyright (c) 2010 flukso.net
include $(TOPDIR)/rules.mk
PKG_NAME:=button
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/button
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=
TITLE:=Button
endef
define Package/button/description
Helper bash scripts used as a callback for hotplug button events. net_toggle toggles between ethernet and wifi mode. net_defaults reverts all firewall, network and wireless settings to factory defaults.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
endef
define Package/button/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/net_toggle $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/net_defaults $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,button))

View File

@ -1,17 +0,0 @@
#!/bin/sh
# Copyright (c) 2010 flukso.net
cd /rom/etc/config
cp firewall network wireless /etc/config
logger 'returning to firewall, network and wireless defaults'
gpioctl dirout 4
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
gpioctl clear 4
gpioctl set 4
done
/etc/init.d/network restart

View File

@ -1,47 +0,0 @@
#!/bin/sh
# Copyright (c) 2010 flukso.net
to_wifi ()
{
uci set firewall.@zone[1].input=REJECT
uci set network.wan.ifname=ath0
uci set network.lan.ifname=eth0
uci set wireless.wifi0.disabled=0
uci set wireless.@wifi-iface[0].network=wan
uci set wireless.@wifi-iface[0].mode=sta
uci commit
logger 'toggled to wifi mode'
}
to_eth ()
{
uci set firewall.@zone[1].input=ACCEPT
uci set network.wan.ifname=eth0
uci set network.lan.ifname=ath0
uci set wireless.wifi0.disabled=1
uci set wireless.@wifi-iface[0].network=lan
uci set wireless.@wifi-iface[0].mode=ap
uci commit
logger 'toggled to eth mode'
}
MODE=$(uci get network.wan.ifname)
if [ $MODE == eth0 ]
then
to_wifi
elif [ $MODE == ath0 ]
then
to_eth
fi
gpioctl dirout 4
for i in 1 2 3 4 5
do
gpioctl clear 4
gpioctl set 4
done
/etc/init.d/network restart

View File

@ -1,62 +0,0 @@
10
dir
25991
svn://svn.openwrt.org/openwrt/packages/libs/expat
svn://svn.openwrt.org/openwrt
2010-12-10T23:26:49.287988Z
24463
jow
3c298f89-4303-0410-b956-a3cf2f4a3e73
Makefile
file
2010-12-21T20:35:59.616046Z
aedd3ed8f43faf5fed06ebaaaf03da81
2010-12-10T23:26:49.287988Z
24463
jow
has-props
1431

View File

@ -1,13 +0,0 @@
K 9
copyright
V 30
Copyright (C) 2006 OpenWrt.org
K 7
licence
V 5
GPLv2
K 13
svn:eol-style
V 6
native
END

View File

@ -1,66 +0,0 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=expat
PKG_VERSION:=2.0.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MD5SUM:=ee8b492592568805593f81f8cdf2a04c
PKG_SOURCE_URL:=@SF/expat
PKG_FIXUP:=libtool
PKG_REMOVE_FILES:=conftools/libtool.m4
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/libexpat
SECTION:=libs
CATEGORY:=Libraries
TITLE:=An XML parsing library
URL:=http://expat.sourceforge.net/
endef
define Package/libexpat/description
A fast, non-validating, stream-oriented XML parsing library.
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-shared \
--enable-static
define Build/Compile
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/expat{,_external}.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libexpat.{a,so*} $(1)/usr/lib/
endef
define Package/libexpat/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libexpat.so.* $(1)/usr/lib/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libexpat))

View File

@ -1,66 +0,0 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=expat
PKG_VERSION:=2.0.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MD5SUM:=ee8b492592568805593f81f8cdf2a04c
PKG_SOURCE_URL:=@SF/expat
PKG_FIXUP:=libtool
PKG_REMOVE_FILES:=conftools/libtool.m4
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/libexpat
SECTION:=libs
CATEGORY:=Libraries
TITLE:=An XML parsing library
URL:=http://expat.sourceforge.net/
endef
define Package/libexpat/description
A fast, non-validating, stream-oriented XML parsing library.
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-shared \
--enable-static
define Build/Compile
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
endef
define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/expat{,_external}.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libexpat.{a,so*} $(1)/usr/lib/
endef
define Package/libexpat/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libexpat.so.* $(1)/usr/lib/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libexpat))

View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

Some files were not shown because too many files have changed in this diff Show More