Merge branch 'master' of https://github.com/TitanMKD/hackrf
This commit is contained in:
@ -45,7 +45,7 @@ OBJDUMP = $(PREFIX)-objdump
|
|||||||
GDB = $(PREFIX)-gdb
|
GDB = $(PREFIX)-gdb
|
||||||
TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
||||||
|
|
||||||
CFLAGS += -O2 -g -Wall -Wextra -I$(LIBOPENCM3)/include -I../common \
|
CFLAGS += -O2 -g3 -Wall -Wextra -I$(LIBOPENCM3)/include -I../common \
|
||||||
-fno-common -mcpu=cortex-m4 -mthumb -MD \
|
-fno-common -mcpu=cortex-m4 -mthumb -MD \
|
||||||
-mfloat-abi=hard -mfpu=fpv4-sp-d16 \
|
-mfloat-abi=hard -mfpu=fpv4-sp-d16 \
|
||||||
$(HACKRF_OPTS)
|
$(HACKRF_OPTS)
|
||||||
|
@ -77,11 +77,9 @@ void cpu_clock_init(void)
|
|||||||
|
|
||||||
/* power on the oscillator and wait until stable */
|
/* power on the oscillator and wait until stable */
|
||||||
CGU_XTAL_OSC_CTRL &= ~CGU_XTAL_OSC_CTRL_ENABLE;
|
CGU_XTAL_OSC_CTRL &= ~CGU_XTAL_OSC_CTRL_ENABLE;
|
||||||
delay(1000000);
|
|
||||||
|
|
||||||
/* use XTAL_OSC as clock source for BASE_M4_CLK (CPU) */
|
/* use XTAL_OSC as clock source for BASE_M4_CLK (CPU) */
|
||||||
CGU_BASE_M4_CLK = (CGU_BASE_CLK_AUTOBLOCK
|
CGU_BASE_M4_CLK = ((CGU_SRC_XTAL << CGU_BASE_CLK_SEL_SHIFT));
|
||||||
| (CGU_SRC_XTAL << CGU_BASE_CLK_SEL_SHIFT));
|
|
||||||
|
|
||||||
/* use XTAL_OSC as clock source for APB1 */
|
/* use XTAL_OSC as clock source for APB1 */
|
||||||
CGU_BASE_APB1_CLK = (CGU_BASE_CLK_AUTOBLOCK
|
CGU_BASE_APB1_CLK = (CGU_BASE_CLK_AUTOBLOCK
|
||||||
@ -111,9 +109,7 @@ void cpu_clock_init(void)
|
|||||||
while (!(CGU_PLL1_STAT & CGU_PLL1_STAT_LOCK));
|
while (!(CGU_PLL1_STAT & CGU_PLL1_STAT_LOCK));
|
||||||
|
|
||||||
/* use PLL1 as clock source for BASE_M4_CLK (CPU) */
|
/* use PLL1 as clock source for BASE_M4_CLK (CPU) */
|
||||||
CGU_BASE_M4_CLK = (CGU_BASE_CLK_AUTOBLOCK
|
CGU_BASE_M4_CLK = ((CGU_SRC_PLL1 << CGU_BASE_CLK_SEL_SHIFT));
|
||||||
| (CGU_SRC_PLL1 << CGU_BASE_CLK_SEL_SHIFT));
|
|
||||||
delay(1000000);
|
|
||||||
|
|
||||||
/* use XTAL_OSC as clock source for PLL0USB */
|
/* use XTAL_OSC as clock source for PLL0USB */
|
||||||
CGU_PLL0USB_CTRL = (CGU_PLL0USB_CTRL_PD
|
CGU_PLL0USB_CTRL = (CGU_PLL0USB_CTRL_PD
|
||||||
|
@ -53,6 +53,8 @@ void gpio_setup(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
u32 i;
|
||||||
|
|
||||||
gpio_setup();
|
gpio_setup();
|
||||||
|
|
||||||
gpio_set(PORT_EN1V8, PIN_EN1V8); /* 1V8 on */
|
gpio_set(PORT_EN1V8, PIN_EN1V8); /* 1V8 on */
|
||||||
@ -61,7 +63,26 @@ int main(void)
|
|||||||
|
|
||||||
gpio_set(PORT_LED1_3, (PIN_LED1|PIN_LED2|PIN_LED3)); /* LEDs on */
|
gpio_set(PORT_LED1_3, (PIN_LED1|PIN_LED2|PIN_LED3)); /* LEDs on */
|
||||||
|
|
||||||
while (1);
|
while (1)
|
||||||
|
{
|
||||||
|
gpio_set(PORT_LED1_3, (PIN_LED1)); /* LEDs on */
|
||||||
|
for (i = 0; i < 2000000; i++) /* Wait a bit. */
|
||||||
|
__asm__("nop");
|
||||||
|
|
||||||
|
gpio_set(PORT_LED1_3, (PIN_LED1|PIN_LED2)); /* LEDs on */
|
||||||
|
for (i = 0; i < 2000000; i++) /* Wait a bit. */
|
||||||
|
__asm__("nop");
|
||||||
|
|
||||||
|
gpio_set(PORT_LED1_3, (PIN_LED1|PIN_LED2|PIN_LED3)); /* LED off */
|
||||||
|
for (i = 0; i < 2000000; i++) /* Wait a bit. */
|
||||||
|
__asm__("nop");
|
||||||
|
|
||||||
|
gpio_clear(PORT_LED1_3, (PIN_LED1|PIN_LED2|PIN_LED3)); /* LED off */
|
||||||
|
for (i = 0; i < 2000000; i++) /* Wait a bit. */
|
||||||
|
__asm__("nop");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user