Skip to content

Instantly share code, notes, and snippets.

@mithro
Last active September 7, 2016 07:38
Show Gist options
  • Save mithro/cb2146e55b3e7a70762f8d20134e8207 to your computer and use it in GitHub Desktop.
Save mithro/cb2146e55b3e7a70762f8d20134e8207 to your computer and use it in GitHub Desktop.
diff -u -r an0042_efm32_usb_uart_bootloader/src/main.c an0042_efm32_usb_uart_bootloader_hg/src/main.c
--- an0042_efm32_usb_uart_bootloader/src/main.c 2015-11-05 14:45:54.000000000 +1100
+++ an0042_efm32_usb_uart_bootloader_hg/src/main.c 2016-02-18 20:00:18.000000000 +1100
@@ -46,6 +46,7 @@
#include "retargetdebug.h"
/*** Typedef's and defines. ***/
+#define BOOTLOADER_VERSION_STRING "EFM32HG bootloader v1.0"
/** Version string, used when the user connects */
#if !defined( BOOTLOADER_VERSION_STRING )
@@ -154,6 +155,7 @@
NVIC_DisableIRQ( RTC_IRQn );
+#if !defined( CMU_OSCENCMD_USHFRCOEN )
/* Try to start HFXO. */
CMU_OscillatorEnable( cmuOsc_HFXO, true, false );
@@ -164,7 +166,10 @@
{
i--;
}
-
+#else
+ i = 1;
+#endif
+
USBTIMER_Init();
#if !defined( NO_RAMFUNCS )
@@ -189,7 +194,9 @@
}
else
{
+#if !defined( CMU_OSCENCMD_USHFRCOEN )
CMU_ClockSelectSet( cmuClock_HF, cmuSelect_HFXO );
+#endif
USBD_Init( &initstruct ); /* Start USB CDC functionality */
}
diff -u -r an0042_efm32_usb_uart_bootloader/src/usbconfig.h an0042_efm32_usb_uart_bootloader_hg/src/usbconfig.h
--- an0042_efm32_usb_uart_bootloader/src/usbconfig.h 2015-11-05 14:45:54.000000000 +1100
+++ an0042_efm32_usb_uart_bootloader_hg/src/usbconfig.h 2016-02-18 20:00:18.000000000 +1100
@@ -41,6 +41,10 @@
#define USB_DEVICE
+#define USB_CORECLK_HFRCO /* Use HFRCO as core clock, default is HFXO. */
+
+#define USB_USBC_32kHz_CLK USB_USBC_32kHz_CLK_LFRCO
+
/****************************************************************************
** **
** Specify number of endpoints used (in addition to EP0). **
Only in an0042_efm32_usb_uart_bootloader_hg/src: usbconfig_origin.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment