Increased the default Cooja CFS size to 4000 bytes so that examples work (found by Roger Larsson)

This commit is contained in:
adamdunkels 2010-11-15 21:44:37 +00:00
parent 0a8331f7e6
commit 9446d37285
2 changed files with 5 additions and 4 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: cfs-cooja.c,v 1.11 2010/02/05 08:59:51 fros4943 Exp $
* $Id: cfs-cooja.c,v 1.12 2010/11/15 21:44:37 adamdunkels Exp $
*/
#include <string.h>
#include "lib/simEnvChange.h"
@ -49,7 +49,7 @@ static struct filestate file;
const struct simInterface cfs_interface;
// COOJA variables
#define CFS_BUF_SIZE 1000 /* Configure CFS size here and in ContikiCFS.java */
#define CFS_BUF_SIZE 4000 /* Configure CFS size here and in ContikiCFS.java */
char simCFSData[CFS_BUF_SIZE] = { 0 };
char simCFSChanged = 0;
int simCFSRead = 0;
@ -102,6 +102,7 @@ cfs_write(int f, const void *buf, unsigned int len)
if(file.flag == FLAG_FILE_OPEN && file.access & CFS_WRITE) {
if(file.fileptr + len > CFS_BUF_SIZE) {
len = CFS_BUF_SIZE - file.fileptr;
printf("cfs-cooja.c: warning: write truncated\n");
}
memcpy(&simCFSData[file.fileptr], buf, len);
file.fileptr += len;

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ContikiCFS.java,v 1.11 2010/02/05 09:01:06 fros4943 Exp $
* $Id: ContikiCFS.java,v 1.12 2010/11/15 21:44:38 adamdunkels Exp $
*/
package se.sics.cooja.contikimote.interfaces;
@ -70,7 +70,7 @@ import se.sics.cooja.interfaces.PolledAfterActiveTicks;
public class ContikiCFS extends MoteInterface implements ContikiMoteInterface, PolledAfterActiveTicks {
private static Logger logger = Logger.getLogger(ContikiCFS.class);
public int FILESYSTEM_SIZE = 1000; /* Configure CFS size here and in cfs-cooja.c */
public int FILESYSTEM_SIZE = 4000; /* Configure CFS size here and in cfs-cooja.c */
private Mote mote = null;
private SectionMoteMemory moteMem = null;