mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-09-20 00:55:58 -04:00
0.1.05 - added board dependant max # segments (thanks bricoleau)
This commit is contained in:
parent
279b0bd9b2
commit
8ff93f5c5a
@ -1,13 +1,14 @@
|
||||
//
|
||||
// FILE: BitArray.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.04
|
||||
// VERSION: 0.1.05
|
||||
// PURPOSE: BitArray library for Arduino
|
||||
// URL: http://forum.arduino.cc/index.php?topic=361167
|
||||
|
||||
//
|
||||
// Released to the public domain
|
||||
//
|
||||
// 0.1.05 - added board dependant max # segments (thanks bricoleau)
|
||||
// 0.1.04 - improve performance
|
||||
// 0.1.03 - refactoring
|
||||
// 0.1.02 - first stabile version (at last)
|
||||
|
@ -3,7 +3,7 @@
|
||||
//
|
||||
// FILE: BitArray.h
|
||||
// AUTHOR: Rob dot Tillaart at gmail dot com
|
||||
// VERSION: 0.1.04
|
||||
// VERSION: 0.1.05
|
||||
// PURPOSE: BitArray library for Arduino
|
||||
// HISTORY: See BitArray.cpp
|
||||
//
|
||||
@ -26,11 +26,37 @@
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
|
||||
#define BITARRAY_LIB_VERSION "0.1.04"
|
||||
|
||||
#define BA_MAX_SEGMENTS 8
|
||||
#define BITARRAY_LIB_VERSION "0.1.05"
|
||||
#define BA_SEGMENT_SIZE 200
|
||||
|
||||
// max memory is board type dependant
|
||||
// note the bitArray does not use all of the RAM
|
||||
// 1K - max 600
|
||||
#if defined(__AVR_ATmega168__)
|
||||
#define BA_MAX_SEGMENTS 3
|
||||
// 2K - max 1600
|
||||
#elif defined(__AVR_ATmega328P__)
|
||||
#define BA_MAX_SEGMENTS 8
|
||||
// 8K - max 7000
|
||||
#elif defined(__AVR_ATmega1280__)
|
||||
#define BA_MAX_SEGMENTS 35
|
||||
// 8K - max 7000
|
||||
#elif defined(__AVR_ATmega2560__)
|
||||
#define BA_MAX_SEGMENTS 35
|
||||
// 1.25K - max 800
|
||||
#elif defined(__AVR_ATmega16U4__)
|
||||
#define BA_MAX_SEGMENTS 4
|
||||
// 2.5K - max 2000
|
||||
#elif defined(__AVR_ATmega32U4__)
|
||||
#define BA_MAX_SEGMENTS 10
|
||||
// 96K (64 + 32) DUE...
|
||||
#elif defined(__SAM3X8E__)
|
||||
#define BA_MAX_SEGMENTS 100
|
||||
// default max 1000
|
||||
#else
|
||||
#define BA_MAX_SEGMENTS 5
|
||||
#endif
|
||||
|
||||
#define BA_ERR 0xFFFFFFFF
|
||||
#define BA_OK 0x00
|
||||
#define BA_NO_MEMORY 0x01
|
||||
|
Loading…
Reference in New Issue
Block a user