|
From: Johann G. <Joh...@gm...> - 2009-01-11 16:06:15
|
Hi! Thanks for your valuable feedback. I'll put all three answers together to one EMail and answer at once. Am Mittwoch, den 31.12.2008, 17:43 +0100 schrieb Maarten Brock: > I'm not sure what to do with the library. SDCC currently has almost > no library code for 8051 derivatives and I'm not sure if we want to > start to. Most library functionality can be found on the SDCC OKR, > on www.8052.com or on the website of the manufacturer. But I'm just > one vote so let's see what others have to say about it. Am Mittwoch, den 31.12.2008, 13:34 -0500 schrieb Dave McGuire: > Just chiming in with an opinion here. I'm very happy to hear > about Hansi's library, and am looking forward to using it. I don't, > however, think it should be distributed with SDCC. It is not a part > of the compiler or the standard C library, so it shouldn't be > distributed with it. I have to admin that I didn't look very closely at the libraries supplied with SDCC but only remembered that there were some I2C routines for the Cypress EZ-USB. But I'm happy to ship my libraries with SDCC OKR or www.8052.com. I'll submit them as soon I've integrated your feedback. Am Mittwoch, den 31.12.2008, 18:11 +0100 schrieb Borut Razem: > I have also a concern about the license you chosen: in the embedded > world LGPL is equal to GPL: it doesn't allow to statically link the > (L)GPL library with the closed source code. If you want to enable > linking your library with the proprietary code I propose GPL+LE - GPL > plus Library (or Runtime) Exception. See > http://sdcc.sourceforge.net/wiki/index.php?page=Library+License+Selection. Thanks for this suggestion. I'll modify the library to GPL+LE. Am Mittwoch, den 31.12.2008, 17:43 +0100 schrieb Maarten Brock: > The headers could be included and I'm glad you already used > compiler.h. But I do not like anything I see in uctypes.h. NULL, > bool and the int's are all already defined in stdlib.h, stdbool.h > and stdint.h. Please use those. Using 'bool' as defined by stdbool.h as a bit makes problems when using functions with a bool return type and making a pointer to such a function. typedef bool (*BoolReturnFunc_t)(); bool TestFunc() { return true } void test() { BoolReturnFunc_t FuncPtr; FuncPtr = &TestFunc; // <-- error } gives the error error 35: '&' illegal operand , address of bit variable Probably this is just a bug report. I've modified all such functions to return an uint8_t. For all others I use bool and stdbool.h. I've also removed uctypes.h and use stdint.h everywhere. Thanks for the hint that all this is already prepared. :-) > And when compiling with --std-c89 you cannot use // comments nor > 'xdata'. Please use /* */ and __xdata instead. Is the possibility to compile with --std-c89 mandatory? I tried to compile with --std-c89 and it gives the warning warning 187: ISO C90 does not support flexible array members for an "open" array element of typedef struct { ... int Field[]; } name; How can I get rid of this warning? Everything else in the library I've changed to be --std-c89 compliant. > Personally, I am totally against function implementations in header > files unless 'inline'd. But inline again is C99 only. I'm too against implementations in .h files. Where did you find those? > Finally, are you sure the TUSB is completely 8052 compatible? > Otherwise I'd prefer not to include 8052.h and copy the relevant > portions only. Yes, the datasheet says: * Integrated 8052 Microcontroller With: - 256 × 8 RAM for Internal Data - 8K × 8 RAM Code Space Available for Downloadable Firmware From Host or I2C Port. - 512 × 8 Shared RAM Used for Data Buffers and Endpoint Descriptor Blocks (EDB) - Four 8052 GPIO Ports, Ports 0,1, 2, and 3 - Master I2C Controller for External Slave Device Access - Watchdog Timer So it is a real 8052 and not an 8051. Bye Hansi |