Browse files

Minor changes to suppress the new Code Analysis warnings in Eclipse I…

…ndigo.
  • Loading branch information...
1 parent 48f7737 commit 81272ebd160adfb7971baf2f8cbe16d38bb0e144 @DavidEGrayson DavidEGrayson committed Nov 22, 2011
View
1 apps/serial_i2c/serial_i2c.c
@@ -124,6 +124,7 @@ void parseCmd(uint8 byte)
break;
}
// if not started, fall through to error
+ // no break here (this comment is required to suppress Eclipse Code Analysis warning)
default:
errors |= ERR_CMD_INVALID;
View
2 apps/test_random/test_random.c
@@ -108,7 +108,7 @@ void receiveCommands()
response[responseLength++] = '\r';
response[responseLength++] = '\n';
break;
- default: response[0] = '?';
+ default: response[0] = '?'; break;
}
usbComTxSend(response, responseLength);
}
View
20 libraries/include/cc2511_map.h
@@ -19,10 +19,6 @@
#define __xdata
#endif
-#ifdef SDCC
-// Syntax for the SDCC (Small Device C Compiler).
-#define SFR(address, name) static __sfr __at (address) name;
-#define SBIT(address, name) static __sbit __at (address) name;
#define SFRBIT(address, name, bit7, bit6, bit5, bit4, bit3, bit2, bit1, bit0) \
SFR(address, name) \
SBIT(address+0, bit0) \
@@ -33,6 +29,11 @@
SBIT(address+5, bit5) \
SBIT(address+6, bit6) \
SBIT(address+7, bit7)
+
+#ifdef SDCC
+// Syntax for the SDCC (Small Device C Compiler).
+#define SFR(address, name) static __sfr __at (address) name;
+#define SBIT(address, name) static __sbit __at (address) name;
#define SFR16(addressH, addressL, name) static __sfr16 __at (((addressH) << 8) + (addressL)) name;
#define SFRX(address, name) static volatile unsigned char __xdata __at(address) name;
@@ -68,6 +69,15 @@ ISR(UTX1, 0)
*/
#define ISR(source, bank) void ISR_##source() __interrupt(source##_VECTOR) __using(bank)
+#elif defined(__CDT_PARSER__)
+
+// These definitions are here to avoid "Symbol x could not be resolved" errors
+// from the Eclipse Code Analysis tool.
+#define SFR(address, name) static unsigned char name;
+#define SBIT(address, name) static unsigned char name;
+#define SFR16(addressH, addressL, name) static unsigned short name;
+#define SFRX(address, name) static unsigned char name;
+
#else
#error "Unknown compiler."
#endif
@@ -393,4 +403,4 @@ typedef struct
} DMA_CONFIG;
-#endif
+#endif
View
12 libraries/include/cc2511_types.h
@@ -64,17 +64,14 @@ typedef __bit BIT;
*/
#define XDATA __xdata
-
#elif defined(__CDT_PARSER__)
-#else
-#error "Unknown compiler."
-#endif
-// Avoid syntax errors in eclipse.
+// Avoid syntax and semantic errors in eclipse.
#ifdef __CDT_PARSER__
#define __xdata
#define __pdata
#define __data
+#define __code
#define xdata
#define pdata
#define data
@@ -86,7 +83,10 @@ typedef __bit BIT;
#define XDATA
#define DATA
#define PDATA
+typedef unsigned char BIT;
#define ISR(source, bank) void ISR_##source()
#endif
-#endif
+#else
+#error "Unknown compiler."
+#endif
View
12 libraries/src/usb_hid/usb_hid.c
@@ -416,11 +416,9 @@ void usbCallbackSetupHandler(void)
case HID_JOYSTICK_INTERFACE_NUMBER:
usbControlRead(sizeof(usbHidJoystickInput), (uint8 XDATA *)&usbHidJoystickInput);
return;
-
- default:
- // unrecognized interface - stall
- return;
}
+ // unrecognized interface - stall
+ return;
// required for devices with Output reports
case HID_REQUEST_SET_REPORT:
@@ -462,11 +460,9 @@ void usbCallbackSetupHandler(void)
response = hidMouseProtocol;
usbControlRead(1, (uint8 XDATA *)&response);
return;
-
- default:
- // unrecognized interface - stall
- return;
}
+ // unrecognized interface - stall
+ return;
// required for boot devices
case HID_REQUEST_SET_PROTOCOL:

0 comments on commit 81272eb

Please sign in to comment.