Skip to content

Commit

Permalink
Fix Mynewt build for Microchip PIC32MZ devices.
Browse files Browse the repository at this point in the history
definition of DEBUG breaks Microchip pic32 builds for Mynewt.
When MCU is not VALENTYUSB_EPTRI there is no need to have any
preprocessor definitions.
It may not look like a big deal but for xc32 builds, compiler
automatically force-includes some file that have structure with field name
DEBUG that result in build error in dcd_eptri.c when this file
is not really needed.

Moving DEBUG and LOG_USB few lines down should not break eptri builds.
  • Loading branch information
kasjer committed Dec 27, 2021
1 parent a6789b5 commit 7a596b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/portable/valentyusb/eptri/dcd_eptri.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
* This file is part of the TinyUSB stack.
*/

#include "tusb_option.h"

#if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_VALENTYUSB_EPTRI)

#ifndef DEBUG
#define DEBUG 0
#endif
Expand All @@ -32,10 +36,6 @@
#define LOG_USB 0
#endif

#include "tusb_option.h"

#if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_VALENTYUSB_EPTRI)

#include "device/dcd.h"
#include "dcd_eptri.h"
#include "csr.h"
Expand Down

0 comments on commit 7a596b9

Please sign in to comment.