Hi,

> First, pardon if this isn't the right forum; should that be a case, I'd 
> appreciate a push in the correct direction.

This forum should be fine.

> I'm trying to use the excellent CSS->SDCC migration kit found at 
> http://particle.teco.edu/software/sdcc/sdccmigration.html to port a 

Cool, someone is using the outcome of my study thesis from two years ago! Great.

> > #define output_bit3(port, pin, value)  do {LAT##port##bits.LAT##port##pin = 
> > value; set_mode_##port(FALSE, pin); } while(0)
> > #define output_bit2(pin, value)        output_bit3(pin, value)
> > #define output_bit(dest, value)        output_bit2(PIN(dest),value)
> 
> So -- output_bit2(pin,value) just calls output_bit3 with the exact same 
> parameters. As output_bit3() requires a port argument, however, we have 
> a problem:
> > onewire.c:44:4: macro "output_bit3" requires 3 arguments, but only 2 given
> > onewire.c:46:4: macro "output_float_set" requires 2 arguments, but only 1 
> > given
> > onewire.c:48:9: macro "input_from_pin2" requires 2 arguments, but only 1 
> > given

This was OK or rather a workaround for the previously used SDCC preprocessor:
In some cases another macro resolution step was required to turn "PIN(31760)" 
into (say) "A,0" which then was to be fed into output_pin3 as three arguments:
output_pin(31760, 1) --> output_pin2(PIN(31760), 1) --> output_pin3(A, 3, 1) 
--> longish C code (do not read, you have been warned...)
This indirection within the preprocessor magic has probably been 
invalidated/removed/broken by the latest upgrade of the preprocessor some weeks 
ago. 

You may now replace output_bit(dest, value) with
#define output_bit(dest,value) output_bit3(__VA_ARGS__)

This should get you going for the first error.
I did not (yet) look at the other macros, but probably similar shortcuts will 
do the job, maybe the indirection can be removed completely, renaming 
output_bit3 to output_bit and input_from_pin2 tp input_from_pin.
I will have to look further into output_float_set to find the error there, but 
right now I am not at my own box, which makes things more difficult. I will 
look into this on Sunday evening or early next week unless you indicate success 
before that.

Regards,
Raphael

_______________________________________________________________________
Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to