fix g_dfu access from both DFU and runtime access

We need to refer to g_dfu as a pointer from all code.  In DFU mode, it
gets assigned to the address of _g_dfu, which is placed by the linker
script at the start of RAM.  In runtime mode, the pointer is statically
defined to point at the start of RAM.  The linker script for the runtime
(dfu environment) is adjusted to save the first 32 bytes for the _g_dfu
structure.
This commit is contained in:
Harald Welte
2017-02-28 01:02:24 +01:00
parent 65cca7cccc
commit adba0ce80b
6 changed files with 67 additions and 63 deletions

View File

@@ -1164,7 +1164,7 @@ void USBD_IrqHandler(void)
TRACE_INFO_WP("EoBRes ");
#if defined(BOARD_USB_DFU) && defined(dfu)
if (g_dfu.past_manifest)
if (g_dfu->past_manifest)
USBDFU_SwitchToApp();
#endif