From c4b19de8ebddb5693be7f7ec27306fd28a273750 Mon Sep 17 00:00:00 2001 From: Chris Nisbet Date: Sat, 14 Jun 2014 12:46:23 +1200 Subject: [PATCH 1/4] CN - Couple of bug fixes in USB code. This functions the bugs were in don't appear to be called by any of the OpenTX code. --- .../Libraries/STM32_USB_OTG_Driver/src/usb_core.c | 4 ++-- .../Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c b/radio/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c index e257e73dc..9b35db089 100644 --- a/radio/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c +++ b/radio/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c @@ -1961,7 +1961,7 @@ void USB_OTG_ActiveRemoteWakeup(USB_OTG_CORE_HANDLE *pdev) if(pdev->cfg.low_power) { /* un-gate USB Core clock */ - power.d32 = USB_OTG_READ_REG32(&pdev->regs.PCGCCTL); + power.d32 = USB_OTG_READ_REG32(pdev->regs.PCGCCTL); power.b.gatehclk = 0; power.b.stoppclk = 0; USB_OTG_WRITE_REG32(pdev->regs.PCGCCTL, power.d32); @@ -1995,7 +1995,7 @@ void USB_OTG_UngateClock(USB_OTG_CORE_HANDLE *pdev) if(dsts.b.suspsts == 1) { /* un-gate USB Core clock */ - power.d32 = USB_OTG_READ_REG32(&pdev->regs.PCGCCTL); + power.d32 = USB_OTG_READ_REG32(pdev->regs.PCGCCTL); power.b.gatehclk = 0; power.b.stoppclk = 0; USB_OTG_WRITE_REG32(pdev->regs.PCGCCTL, power.d32); diff --git a/radio/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c b/radio/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c index df47649c6..10a60d475 100644 --- a/radio/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c +++ b/radio/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c @@ -358,7 +358,7 @@ static uint32_t DCD_HandleResume_ISR(USB_OTG_CORE_HANDLE *pdev) if(pdev->cfg.low_power) { /* un-gate USB Core clock */ - power.d32 = USB_OTG_READ_REG32(&pdev->regs.PCGCCTL); + power.d32 = USB_OTG_READ_REG32(pdev->regs.PCGCCTL); power.b.gatehclk = 0; power.b.stoppclk = 0; USB_OTG_WRITE_REG32(pdev->regs.PCGCCTL, power.d32); From 6707f689238cd2993a77c58a1f5eb5775492329b Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sat, 14 Jun 2014 08:10:40 +0200 Subject: [PATCH 2/4] One more warning removed: ../targets/taranis/board_taranis.h:256:3: warning: function declaration isn't a prototype [-Wstrict-prototypes] --- radio/src/targets/taranis/board_taranis.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/targets/taranis/board_taranis.h b/radio/src/targets/taranis/board_taranis.h index 0bbe2c79c..7a6c7fe9e 100644 --- a/radio/src/targets/taranis/board_taranis.h +++ b/radio/src/targets/taranis/board_taranis.h @@ -253,7 +253,7 @@ void hapticOff(void); #if defined(REVPLUS) void hapticOn(uint32_t pwmPercent); #else - void hapticOn(); + void hapticOn(void); #define HAPTIC_ON() hapticOn() #endif From 91dfb0309ea479aebdc362e67255e299f95e619b Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sat, 14 Jun 2014 08:18:47 +0200 Subject: [PATCH 3/4] Removed compiler warning: lua.cpp:1382:21: warning: variable 'filename' set but not used [-Wunused-but-set-variable] --- radio/src/lua.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/lua.cpp b/radio/src/lua.cpp index c519e6702..784b467a1 100644 --- a/radio/src/lua.cpp +++ b/radio/src/lua.cpp @@ -1379,7 +1379,7 @@ void luaTask(uint8_t evt) if (sid.state == SCRIPT_OK) { uint8_t prev_mem = lua_gc(L, LUA_GCCOUNT, 0); SET_LUA_INSTRUCTIONS_COUNT(PERMANENT_SCRIPTS_MAX_INSTRUCTIONS); - const char *filename; + const char *filename __attribute__((unused)); ScriptInputsOutputs * sio = NULL; if (sid.reference >= SCRIPT_MIX_FIRST && sid.reference <= SCRIPT_MIX_LAST) { ScriptData & sd = g_model.scriptsData[sid.reference-SCRIPT_MIX_FIRST]; From 10413bbede4d9f7689ed14912a8897f2d83af2d2 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sat, 14 Jun 2014 08:24:00 +0200 Subject: [PATCH 4/4] Removed compiler warning: lua.cpp:63:60: warning: missing braces around initializer for 'ScriptInputsOutputs' [-Wmissing-braces] --- radio/src/lua.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/lua.cpp b/radio/src/lua.cpp index 784b467a1..705b4a8c3 100644 --- a/radio/src/lua.cpp +++ b/radio/src/lua.cpp @@ -60,7 +60,7 @@ lua_State *L = NULL; uint8_t luaState = 0; uint8_t luaScriptsCount = 0; ScriptInternalData scriptInternalData[MAX_SCRIPTS] = { { SCRIPT_NOFILE, 0 } }; -ScriptInputsOutputs scriptInputsOutputs[MAX_SCRIPTS] = { 0 }; +ScriptInputsOutputs scriptInputsOutputs[MAX_SCRIPTS] = { {0} }; ScriptInternalData standaloneScript = { SCRIPT_NOFILE, 0 }; uint16_t maxLuaInterval = 0; uint16_t maxLuaDuration = 0;