From 949cc878979384c21f49017cf4affdcaa28e689b Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Thu, 12 May 2011 04:48:10 -0400 Subject: libmaple: Fix warnings in libmaple source files -Add -Wall, -Werror to libmaple/* -Fix warnings --- libmaple/usb/usb.c | 4 +--- libmaple/usb/usb_callbacks.c | 4 ++-- libmaple/usb/usb_lib/usb_regs.h | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'libmaple/usb') diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c index b34c4b6..617c1ee 100644 --- a/libmaple/usb/usb.c +++ b/libmaple/usb/usb.c @@ -337,7 +337,7 @@ void usbWaitReset(void) { */ void usbBlockingSendByte(char ch) { while (countTx); - UserToPMABufferCopy(&ch,VCOM_TX_ADDR,1); + UserToPMABufferCopy((uint8*)&ch,VCOM_TX_ADDR,1); _SetEPTxCount(VCOM_TX_ENDP,1); _SetEPTxValid(VCOM_TX_ENDP); countTx = 1; @@ -397,8 +397,6 @@ uint32 usbReceiveBytes(uint8* recvBuf, uint32 len) { } void usbSendHello(void) { - char* myStr = "hello!"; - uint8 bufin = 48 + recvBufIn;; uint8 bufout = 48 + recvBufOut; uint8 avail = 48 + usbBytesAvailable(); diff --git a/libmaple/usb/usb_callbacks.c b/libmaple/usb/usb_callbacks.c index 8184537..9694942 100644 --- a/libmaple/usb/usb_callbacks.c +++ b/libmaple/usb/usb_callbacks.c @@ -69,8 +69,8 @@ void vcomDataRxCb(void) { in some cases */ /* magic number, {0x31, 0x45, 0x41, 0x46} is "1EAF" */ - char chkBuf[4]; - char cmpBuf[4] = {0x31, 0x45, 0x41, 0x46}; + uint8 chkBuf[4]; + uint8 cmpBuf[4] = {0x31, 0x45, 0x41, 0x46}; if (reset_state == DTR_NEGEDGE) { reset_state = DTR_LOW; diff --git a/libmaple/usb/usb_lib/usb_regs.h b/libmaple/usb/usb_lib/usb_regs.h index a888f72..b63cc5f 100644 --- a/libmaple/usb/usb_lib/usb_regs.h +++ b/libmaple/usb/usb_lib/usb_regs.h @@ -357,9 +357,9 @@ enum EP_BUF_NUM * Return : None. *******************************************************************************/ #define _ToggleDTOG_RX(bEpNum) (_SetENDPOINT(bEpNum, \ - EP_DTOG_RX | _GetENDPOINT(bEpNum) & EPREG_MASK)) + EP_DTOG_RX | (_GetENDPOINT(bEpNum) & EPREG_MASK))) #define _ToggleDTOG_TX(bEpNum) (_SetENDPOINT(bEpNum, \ - EP_DTOG_TX | _GetENDPOINT(bEpNum) & EPREG_MASK)) + EP_DTOG_TX | (_GetENDPOINT(bEpNum) & EPREG_MASK))) /******************************************************************************* * Macro Name : ClearDTOG_RX / ClearDTOG_TX. @@ -381,7 +381,7 @@ enum EP_BUF_NUM * Return : None. *******************************************************************************/ #define _SetEPAddress(bEpNum,bAddr) _SetENDPOINT(bEpNum,\ - _GetENDPOINT(bEpNum) & EPREG_MASK | bAddr) + (_GetENDPOINT(bEpNum) & EPREG_MASK) | bAddr) /******************************************************************************* * Macro Name : GetEPAddress. -- cgit v1.2.3