I’ve been hacking away at all of the drivers, making them meaner, leaner and easier to use. To go back to the HTAC (HiTechnic Accelerator Sensor) driver as an example, check this out:
HTAC-test1.c (in suite v 1.8.1) |
HTAC-test1.c (1st round) |
HTAC-test1.c (now) |
|
Total code bytes | 4598 | 1643 (-64%) | 1,387 (-70%) |
Memory locations | 716 | 420 (-41%) | 200 (-72%) |
Procedures | 59 | 22 (-63%) | 15 (-75%) |
HTAC-SMUX-test1.c (in suite v 1.8.1) |
HTAC-SMUX-test1.c (1st round) |
HTAC-SMUX-test1.c (now) |
|
Total code bytes | 4618 | 4319 (-6%) | 3208 (-31%) |
Memory locations | 716 | 652 (-9%) | 420 (-41%) |
Procedures | 57 | 46 (-19%) | 32 (-44%) |
Mind you, not all drivers are going to get such big reductions in their memory and task usage, but this should give you an idea.
Other stuff I’ve done is remove the necessity to initialise the Sensor MUX or doing a port scan of the connected sensors in your program. The MUX is automatically configured now without the need to scan on a per-sensor basis. This is also how the official HiTechnic NXT-G blocks operate. I’ve also removed a bunch of functions I felt were just unnecessary and had better alternatives.
I don’t think I’ll be merging the IR Seeker and Colour Sensor drivers, I think it will make the drivers unnecessarily complex. I don’t think many people are using the old sensors now anyway, so that will stay the way it is, for now.
There’s not a lot left to do. I will need to go through all the drivers and add the differences between them and the versions shipped with 1.8.1 to the individual changelogs. Diff is your friend.
How is your 2.0 driver suite progressing. Do you have an example of how to use the Mindsensor’s NXTMMX multiplexer with a sensor. I have the two motors working. I just cannot seem to get a digital sensor to work through the sensor port. For now it is not a big problem as I am still working out other programming problems.
Mike
Hi Michael,
The drivers are as good as finished, it’s the documentation of the changelog that is keeping me. I’ve thought about making just a single central chanelog instead of updating each driver and test file with their individual changes. What do you think? Would a central changelog be enough? Later today I will release a beta version of 2.0 so you can play with it and see if there’s any broken things in it.
I am less concerned about the changelog as I am about there being documentation and code samples, especially for the NXTMMX (Mindsensors motor multiplexer). I would say a central changelog would be my preference. I look forward to trying out the new driver suite.
Mike,