CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

[Solved]reg_httpServer_cbfunc from Wiznet httpServer library

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
allenhuffman



Joined: 17 Jun 2019
Posts: 638
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

[Solved]reg_httpServer_cbfunc from Wiznet httpServer library
PostPosted: Fri Sep 19, 2025 12:53 pm     Reply with quote

A few years ago, I tested a small Wiznet web server on one of our PIC24 boards with the W5500 Wiznet chip.

I am now bringing up a new board with this same W5500 chip and trying it again.

When I include the "httpServer.h", I get these link errors:

Code:
*** Error 29 "Wiznet\Internet\httpServer\httpServer.h" Line 107(32,33): Function definition different from previous definition  reg_httpServer_cbfunc Param#1


That line is the prototype:

Code:
void reg_httpServer_cbfunc(void(*mcu_reset)(void), void(*wdt_reset)(void));


In the corresponding .c, the function is define exactly the same as far as my eyes can see:

Code:
/* Register the call back functions for HTTP Server */
void reg_httpServer_cbfunc(void(*mcu_reset)(void), void(*wdt_reset)(void)) {
    // Callback: HW Reset and WDT reset function for each MCU platforms
    if (mcu_reset) {
        HTTPServer_ReStart = mcu_reset;
    }
    if (wdt_reset) {
        HTTPServer_WDT_Reset = wdt_reset;
    }
}


The older Wiznet library from some years ago may have been different. We only saved out the W5500 code we were using (no application code) so I do not have any of that old code to look at to see if it was different.

I seem to recall something about function pointers in the CCS compiler that needed to be done differently. Anyone recall?

Cheers,
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?

Using: 24FJ256GA106, 24EP256GP202 and 24FJ64GA002.


Last edited by allenhuffman on Fri Sep 19, 2025 3:29 pm; edited 1 time in total
allenhuffman



Joined: 17 Jun 2019
Posts: 638
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Fri Sep 19, 2025 3:29 pm     Reply with quote

I found how this issue was dealt with when we did this a few years ago:

Changing functions that take function pointers:

Code:
void reg_wizchip_cris_cbfunc(void(*cris_en)(void), void(*cris_ex)(void));


...to use a typedef for the parameters:

Code:
typedef void(*CRIS_EN)(void);
typedef void(*CRIS_EX)(void);

void reg_wizchip_cris_cbfunc(CRIS_EN cris_en, CRIS_EX cris_ex);


For anyone working on the current Wiznet W5500 code, they added a few more functions since we originally did this. Here are the typedefs (last few untested, but they compile) so the prototypes and function headers can be updated the same was as that example.

Code:
typedef void(*CRIS_EN)(void);
typedef void(*CRIS_EX)(void);
typedef void(*CS_SEL)(void);
typedef void(*CS_DESEL)(void);
typedef iodata_t(*BUS_RB)(uint32_t addr);
typedef void(*BUS_WB)(uint32_t addr, iodata_t wb);
typedef uint8_t(*SPI_RB)(void);
typedef void(*SPI_WB)(uint8_t wb);
typedef void(*SPI_RBB)(uint8_t* pBuf, uint16_t len);
typedef void(*SPI_WBB)(uint8_t* pBuf, uint16_t len);
typedef void(*VOIDPTR)(void);
typedef void(*BUSBUF_RB)(uint32_t AddrSel, iodata_t* pBuf, int16_t len, uint8_t addrinc);
typedef void(*BUSBUF_WB)(uint32_t AddrSel, iodata_t* pBuf, int16_t len, uint8_t addrinc);
typedef void(*QSPI_RB)(uint8_t opcode, uint16_t addr, uint8_t* pBuf, uint16_t len);
typedef void(*QSPI_WB)(uint8_t opcode, uint16_t addr, uint8_t* pBuf, uint16_t len);

_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?

Using: 24FJ256GA106, 24EP256GP202 and 24FJ64GA002.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group