Dany wrote: I must say that some libraries take a lot more code than before . This is the case for e.g. the "Soft Uart" library (the first one I used ).
Soft UART library is the special case.Dany wrote:I do not know it the same is the case for other libraries...
Old library was made to produce the smallest possible code.
You could have only one Soft UART module in your code.
Knowing that, compiler avoided to pass port/pin parameters as usual, he did some "smart" find-and-replace and produced the smaller code.
Now, many of our users wanted to use more than one Soft UART module in their project and to fulfill that wish we redesigned the library.
Library now passes port/pin parameters as usual.
So now, you can write
Code: Select all
Soft_Uart_Init(&PORTB, 1, 2, 9600, 0);
Soft_Uart_Write(65);
Soft_Uart_Init(&PORTB, 4, 3, 9600, 0);
Soft_Uart_Write(66);
Soft_Uart_Init(&PORTC, 4, 3, 9600, 0);
Soft_Uart_Write(67);
Code size increased, but the library is more flexible, it is a trade off.
Now when PRO compiler reduced size of other libraries and user's code - we realized that it is time to release a more flexible library.
Code size may increase, but other code will be smaller - so it shouldn't be critical (in a means that old project can't fit in the Flash now)
This solution is applied to Button, OneWire, Sound and Soft UART library - we supposed that user's projects may request more than one module there.
We didn't do that with Soft I2C and Soft SPI, they are buses, so we supposed there is no need for more than one bus. (devices are selected using address or CS line)
Another thing: All Software communication libraries + Manchester library
now have anti-blocking mechanism (this was another wish from our users).