FrankVD 0 Posted May 15, 2011 Report Share Posted May 15, 2011 Hello, I found another bug using version 6.97 of BoostC++ while porting part of the microchip TCPIP stack to get MRF24WB0M wifi module to work: (target is PIC18F97J60) #define MY_DEFAULT_IP_ADDR_BYTE1 (unsigned long) (10) #define MY_DEFAULT_IP_ADDR_BYTE2 (unsigned long) (10) #define MY_DEFAULT_IP_ADDR_BYTE3 (unsigned long) (1) #define MY_DEFAULT_IP_ADDR_BYTE4 (unsigned long) (23) #define IP_ADDR unsigned long typedef struct { IP_ADDR MyIPAddr; // IP address } APP_CONFIG; APP_CONFIG MyAPP; main() { MyAPP.MyIPAddr |= MY_DEFAULT_IP_ADDR_BYTE1; MyAPP.MyIPAddr |= MY_DEFAULT_IP_ADDR_BYTE2<<8; MyAPP.MyIPAddr |= MY_DEFAULT_IP_ADDR_BYTE3<<16; MyAPP.MyIPAddr |= MY_DEFAULT_IP_ADDR_BYTE4<<24; // result MyAPP.MyIPAddr= 0x17010A0A (works) MyAPP.MyIPAddr = MY_DEFAULT_IP_ADDR_BYTE1 | MY_DEFAULT_IP_ADDR_BYTE2<<8 | MY_DEFAULT_IP_ADDR_BYTE3<<16 | MY_DEFAULT_IP_ADDR_BYTE4<<24; // result MyAPP.MyIPAddr= 0x17000A0A (does not work, should have the same outcome as above, the 3th byte(MY_DEFAULT_IP_ADDR_BYTE3) is always 0 ) // I tried using the latest version 7.03 and the result with that is: // result MyAPP.MyIPAddr= 0x0000000A ( only the first byte is correct, the rest is 0) } Regars Frank. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.