could we optimize abdrive.h
laurent974
Posts: 77
Why abdrive.c include some header for string and text ?
could those be safely removed ?
#include "simpletools.h" #include "simpletext.h" #include <string.h>
could those be safely removed ?
Comments
This library provides convenient functions for a variety of microcontroller I/O, timing, conversion, and communication tasks. This library also includes (and you can call functions from) simpletext and serial. More...
#include <propeller.h>
#include "simpletext.h"
#include <driver.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cog.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include <sys/sd.h>
#include <math.h>
#include "simplei2c.h"
So i would like to save a few memory to get rid of the string.h or simpletext.h.
anyway, abdrive is only for encoders or servo drive. it should not be about text.
I like your way of thinking and you are right there.
abdrive should not need them headers, except if some constants or debug stuff is in there.
but you do not need to worry, because PropGCC does not include all of this into your created binary for the propeller, just stuff you USE in your code.
Enjoy!
Mike