diff options
author | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-11-06 20:26:48 +0000 |
---|---|---|
committer | henryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2007-11-06 20:26:48 +0000 |
commit | 633c646ab36368caf6eaeedd326d9f1835196afd (patch) | |
tree | fdd0f60747745d3e528c0f5d8f8895b26fb79633 /openpicc/application/env.h | |
parent | 3b41196cb6b64cf6ba8ba41d6995428f73d4764a (diff) |
Initial import of FreeRTOS code for OpenPICC
git-svn-id: https://svn.openpcd.org:2342/trunk@311 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/env.h')
-rw-r--r-- | openpicc/application/env.h | 46 |
1 files changed, 46 insertions, 0 deletions
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 <meriac@openbeacon.de> + * + *************************************************************** + + 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__*/ |