aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb
diff options
context:
space:
mode:
authorPerry Hung <iperry@gmail.com>2011-05-12 04:48:10 -0400
committerPerry Hung <iperry@gmail.com>2011-05-12 05:00:47 -0400
commit949cc878979384c21f49017cf4affdcaa28e689b (patch)
tree01f05282f025b23c330963463e698325992e2bb0 /libmaple/usb
parent93bcde9c12582ca441a2aefb6148286e3adfe899 (diff)
downloadlibrambutan-949cc878979384c21f49017cf4affdcaa28e689b.tar.gz
librambutan-949cc878979384c21f49017cf4affdcaa28e689b.zip
libmaple: Fix warnings in libmaple source files
-Add -Wall, -Werror to libmaple/* -Fix warnings
Diffstat (limited to 'libmaple/usb')
-rw-r--r--libmaple/usb/usb.c4
-rw-r--r--libmaple/usb/usb_callbacks.c4
-rw-r--r--libmaple/usb/usb_lib/usb_regs.h6
3 files changed, 6 insertions, 8 deletions
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.