diff --git a/firmware/README b/firmware/README index fc398a6b..55ee089f 100644 --- a/firmware/README +++ b/firmware/README @@ -31,11 +31,6 @@ $ hackrf_spiflash -w hackrf_usb.bin If you have a Jawbreaker, add -DBOARD=JAWBREAKER to the cmake command. If you have a rad1o, use -DBOARD=RAD1O instead. -If you have a HackRF One and want to build optional PortaPack display support, -also specify -DUSER_INTERFACE=PORTAPACK. If PortaPack hardware is not detected -by hardware probing at start-up, the HackRF firmware will run without UI -support. - It is possible to use a USB Device Firmware Upgrade (DFU) method to load firmware into RAM. This is normally only required to recover a device that has had faulty firmware loaded, but it can also be useful for firmware developers. diff --git a/firmware/common/cpld_jtag.c b/firmware/common/cpld_jtag.c index 5edcc67a..b07d9b54 100644 --- a/firmware/common/cpld_jtag.c +++ b/firmware/common/cpld_jtag.c @@ -35,18 +35,14 @@ void cpld_jtag_take(jtag_t* const jtag) { /* Set initial GPIO state to the voltages of the internal or external pull-ups/downs, * to avoid any glitches. */ -#ifdef USER_INTERFACE_PORTAPACK gpio_set(gpio->gpio_pp_tms); -#endif gpio_set(gpio->gpio_tms); gpio_set(gpio->gpio_tdi); gpio_clear(gpio->gpio_tck); -#ifdef USER_INTERFACE_PORTAPACK /* Do not drive PortaPack-specific TMS pin initially, just to be cautious. */ gpio_input(gpio->gpio_pp_tms); gpio_input(gpio->gpio_pp_tdo); -#endif gpio_output(gpio->gpio_tms); gpio_output(gpio->gpio_tdi); gpio_output(gpio->gpio_tck); @@ -59,11 +55,9 @@ void cpld_jtag_release(jtag_t* const jtag) { /* Make all pins inputs when JTAG interface not active. * Let the pull-ups/downs do the work. */ -#ifdef USER_INTERFACE_PORTAPACK /* Do not drive PortaPack-specific pins, initially, just to be cautious. */ gpio_input(gpio->gpio_pp_tms); gpio_input(gpio->gpio_pp_tdo); -#endif gpio_input(gpio->gpio_tms); gpio_input(gpio->gpio_tdi); gpio_input(gpio->gpio_tck); diff --git a/firmware/common/cpld_jtag.h b/firmware/common/cpld_jtag.h index 14500824..1b62b474 100644 --- a/firmware/common/cpld_jtag.h +++ b/firmware/common/cpld_jtag.h @@ -31,10 +31,8 @@ typedef struct jtag_gpio_t { gpio_t gpio_tck; gpio_t gpio_tdi; gpio_t gpio_tdo; -#ifdef USER_INTERFACE_PORTAPACK gpio_t gpio_pp_tms; gpio_t gpio_pp_tdo; -#endif } jtag_gpio_t; typedef struct jtag_t { diff --git a/firmware/common/hackrf_core.c b/firmware/common/hackrf_core.c index 68ddf161..fbc2191e 100644 --- a/firmware/common/hackrf_core.c +++ b/firmware/common/hackrf_core.c @@ -124,10 +124,8 @@ static struct gpio_t gpio_cpld_tms = GPIO(3, 1); static struct gpio_t gpio_cpld_tdi = GPIO(3, 4); #endif -#ifdef USER_INTERFACE_PORTAPACK static struct gpio_t gpio_cpld_pp_tms = GPIO(1, 1); static struct gpio_t gpio_cpld_pp_tdo = GPIO(1, 8); -#endif static struct gpio_t gpio_hw_sync_enable = GPIO(5,12); static struct gpio_t gpio_rx_q_invert = GPIO(0, 13); @@ -276,10 +274,8 @@ jtag_gpio_t jtag_gpio_cpld = { .gpio_tck = &gpio_cpld_tck, .gpio_tdi = &gpio_cpld_tdi, .gpio_tdo = &gpio_cpld_tdo, -#ifdef USER_INTERFACE_PORTAPACK .gpio_pp_tms = &gpio_cpld_pp_tms, .gpio_pp_tdo = &gpio_cpld_pp_tdo, -#endif }; jtag_t jtag_cpld = { @@ -777,10 +773,8 @@ void pin_setup(void) { * * LPC43xx pull-up and pull-down resistors are approximately 53K. */ -#ifdef USER_INTERFACE_PORTAPACK scu_pinmux(SCU_PINMUX_PP_TMS, SCU_GPIO_PUP | SCU_CONF_FUNCTION0); scu_pinmux(SCU_PINMUX_PP_TDO, SCU_GPIO_PDN | SCU_CONF_FUNCTION0); -#endif scu_pinmux(SCU_PINMUX_CPLD_TMS, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0); scu_pinmux(SCU_PINMUX_CPLD_TDI, SCU_GPIO_NOPULL | SCU_CONF_FUNCTION0); scu_pinmux(SCU_PINMUX_CPLD_TDO, SCU_GPIO_PDN | SCU_CONF_FUNCTION4); @@ -818,12 +812,10 @@ void pin_setup(void) { /* Configure RF power supply (VAA) switch control signal as output */ gpio_output(&gpio_vaa_disable); -#ifndef USER_INTERFACE_PORTAPACK /* Not sure why this is necessary for stock HackRF. Just "rhyming" with the RAD1O code? */ scu_pinmux(SCU_PINMUX_GPIO3_10, SCU_GPIO_PDN | SCU_CONF_FUNCTION0); scu_pinmux(SCU_PINMUX_GPIO3_11, SCU_GPIO_PDN | SCU_CONF_FUNCTION0); #endif -#endif #ifdef RAD1O /* Safe state: start with VAA turned off: */ diff --git a/firmware/common/hackrf_core.h b/firmware/common/hackrf_core.h index b30cfdff..6ce543cc 100644 --- a/firmware/common/hackrf_core.h +++ b/firmware/common/hackrf_core.h @@ -77,16 +77,13 @@ extern "C" /* GPIO Input PinMux */ #define SCU_PINMUX_BOOT0 (P1_1) /* GPIO0[8] on P1_1 */ #define SCU_PINMUX_BOOT1 (P1_2) /* GPIO0[9] on P1_2 */ -#ifdef USER_INTERFACE_PORTAPACK +#define SCU_PINMUX_BOOT2 (P2_8) /* GPIO5[7] on P2_8 */ +#define SCU_PINMUX_BOOT3 (P2_9) /* GPIO1[10] on P2_9 */ #define SCU_PINMUX_PP_LCD_TE (P2_3) /* GPIO5[3] on P2_3 */ #define SCU_PINMUX_PP_LCD_RDX (P2_4) /* GPIO5[4] on P2_4 */ #define SCU_PINMUX_PP_UNUSED (P2_8) /* GPIO5[7] on P2_8 */ #define SCU_PINMUX_PP_LCD_WRX (P2_9) /* GPIO1[10] on P2_9 */ #define SCU_PINMUX_PP_DIR (P2_13) /* GPIO1[13] on P2_13 */ -#else -#define SCU_PINMUX_BOOT2 (P2_8) /* GPIO5[7] on P2_8 */ -#define SCU_PINMUX_BOOT3 (P2_9) /* GPIO1[10] on P2_9 */ -#endif /* USB peripheral */ #ifdef JAWBREAKER diff --git a/firmware/common/tuning.c b/firmware/common/tuning.c index cfe09140..e584eaad 100644 --- a/firmware/common/tuning.c +++ b/firmware/common/tuning.c @@ -116,9 +116,7 @@ bool set_freq(const uint64_t freq) if( success ) { freq_cache = freq; hackrf_ui()->set_frequency(freq); -#ifndef USER_INTERFACE_PORTAPACK operacake_set_range(freq_mhz); -#endif } return success; } diff --git a/firmware/common/ui_portapack.c b/firmware/common/ui_portapack.c index e88b131f..e8430af1 100644 --- a/firmware/common/ui_portapack.c +++ b/firmware/common/ui_portapack.c @@ -30,8 +30,6 @@ #include -#ifdef USER_INTERFACE_PORTAPACK - /* Pixel data within a font or bitmap byte is "reversed": LSB is left-most pixel. */ static const uint8_t font_fixed_8x16_glyph_data[] = { @@ -1043,5 +1041,3 @@ const hackrf_ui_t* portapack_detect(void) { return NULL; } } - -#endif diff --git a/firmware/hackrf-common.cmake b/firmware/hackrf-common.cmake index d2d2eded..0d577251 100644 --- a/firmware/hackrf-common.cmake +++ b/firmware/hackrf-common.cmake @@ -71,19 +71,11 @@ else() set(MCU_PARTNO LPC4330) endif() -if(BOARD STREQUAL "RAD1O") - set(USER_INTERFACE RAD1O) -endif() - -if(NOT DEFINED USER_INTERFACE) - set(USER_INTERFACE NONE) -endif() - if(NOT DEFINED SRC_M0) set(SRC_M0 "${PATH_HACKRF_FIRMWARE_COMMON}/m0_sleep.c") endif() -SET(HACKRF_OPTS "-D${BOARD} -DUSER_INTERFACE_${USER_INTERFACE} -DLPC43XX -D${MCU_PARTNO} -DTX_ENABLE -D'VERSION_STRING=\"${VERSION}\"'") +SET(HACKRF_OPTS "-D${BOARD} -DLPC43XX -D${MCU_PARTNO} -DTX_ENABLE -D'VERSION_STRING=\"${VERSION}\"'") SET(LDSCRIPT_M4 "-T${PATH_HACKRF_FIRMWARE_COMMON}/${MCU_PARTNO}_M4_memory.ld -Tlibopencm3_lpc43xx_rom_to_ram.ld -T${PATH_HACKRF_FIRMWARE_COMMON}/LPC43xx_M4_M0_image_from_text.ld") @@ -108,10 +100,7 @@ SET(CFLAGS_M4 "-std=gnu99 ${CFLAGS_COMMON} ${CPUFLAGS_M4} -DLPC43XX_M4") SET(CXXFLAGS_M4 "-std=gnu++0x ${CFLAGS_COMMON} ${CPUFLAGS_M4} -DLPC43XX_M4") SET(LDFLAGS_M4 "${LDFLAGS_COMMON} ${CPUFLAGS_M4} ${LDSCRIPT_M4} -Xlinker -Map=m4.map") -SET(CFLAGS_M4_DFU "-std=gnu99 ${CFLAGS_COMMON} ${CPUFLAGS_M4} -DLPC43XX_M4") -if(NOT USER_INTERFACE STREQUAL "PORTAPACK") - SET(CFLAGS_M4_DFU "${CFLAGS_M4_DFU} -DDFU_MODE") -endif() +SET(CFLAGS_M4_DFU "-std=gnu99 ${CFLAGS_COMMON} ${CPUFLAGS_M4} -DLPC43XX_M4 -DDFU_MODE") SET(LDFLAGS_M4_DFU "${LDFLAGS_COMMON} ${CPUFLAGS_M4} ${LDSCRIPT_M4_DFU} -Xlinker -Map=m4.map") set(BUILD_SHARED_LIBS OFF)