From 633c646ab36368caf6eaeedd326d9f1835196afd Mon Sep 17 00:00:00 2001 From: henryk Date: Tue, 6 Nov 2007 20:26:48 +0000 Subject: Initial import of FreeRTOS code for OpenPICC git-svn-id: https://svn.openpcd.org:2342/trunk@311 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/env.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 openpicc/application/env.h (limited to 'openpicc/application/env.h') diff --git a/openpicc/application/env.h b/openpicc/application/env.h new file mode 100644 index 0000000..50d27b6 --- /dev/null +++ b/openpicc/application/env.h @@ -0,0 +1,46 @@ +/*************************************************************** + * + * OpenBeacon.org - flash routines for persistent environment storage + * + * Copyright 2007 Milosch Meriac + * + *************************************************************** + + 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; version 2. + + 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. +*/ + +#ifndef __ENV_H__ +#define __ENV_H__ + +#define TENVIRONMENT_MAGIC 0x0CCC2007 + +typedef struct +{ + unsigned int magic,size,crc16; + unsigned int mode,speed; + unsigned int reader_id; +} TEnvironment; + +typedef union { + TEnvironment e; + unsigned int data[AT91C_IFLASH_PAGE_SIZE/sizeof(unsigned int)]; +} TEnvironmentBlock; + +extern void env_store(void) RAMFUNC; +extern int env_load(void); +extern void env_init(void); +extern TEnvironmentBlock env; +extern unsigned short env_crc16 (const unsigned char *buffer, int size) RAMFUNC; + +#endif/*__ENV_H__*/ -- cgit v1.2.3