> -----Original Message----- > From: piclist-bounces@mit.edu On Behalf Of Matt Rhys-Roberts > Sent: Thursday, July 22, 2010 11:01 AM > > Please can someone faimilar with C kindly help clear up my > confusion here? > > I'm declaring a couple of SPI function prototypes, see below. Not > wishing to waste too much time testing awkward things, shouldn't the > common variables (sync_mode, bus_mode etc.) be specified more > uniquely for each SPI channel? Will the following, although it > compiles ok, cause ambiguity when it comes to execution? I can't > tell whether prototyping a function is the same as declaring a > variable by name, nor how it's allocating the names following > "unsigned char". > > Many thanks, > Matt > The parameter identifiers in a C function prototype are optional and have a scope limited to the prototype list so, there will be no conflicts or ambiguity. More info @ Paul Hutch > > > void OpenSPI1 > ( > unsigned char sync_mode, > unsigned char bus_mode, > unsigned char smp_phase > ); > unsigned char WriteSPI1(unsigned char data_out ); > > void OpenSPI2 > ( > unsigned char sync_mode, > unsigned char bus_mode, > unsigned char smp_phase > ); > unsigned char WriteSPI2(unsigned char data_out ); > > void Open1USART > ( > unsigned char config, > unsigned int spbrg > ); -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist