to support v1.5.x switch to hackrf usb mode no black screen

/home/jumbo/hackrf/firmware/common/ui_portapack.c

const hackrf_ui_t* portapack_hackrf_ui_init() {

if( portapack() ) {  //switch to hackrf_usb mode, if portapack install set lcd blue screen
    return &portapack_hackrf_ui;
} else {
    return NULL;
}

}
/home/jumbo/hackrf/firmware/common/portapack.c
static uint32_t jtag_pp_idcode(void) {

cpld_jtag_take(&jtag_cpld);

/* TODO: Check if PortaPack TMS is floating or driven by an external device. */
gpio_output(jtag_cpld.gpio->gpio_pp_tms);

/* Test-Logic/Reset -> Run-Test/Idle -> Select-DR/Scan -> Capture-DR */
jtag_pp_shift(0b11111010, 8);

/* Shift-DR */
const uint32_t idcode = jtag_pp_shift(0, 32);

/* Exit1-DR -> Update-DR -> Run-Test/Idle -> ... -> Test-Logic/Reset */
jtag_pp_shift(0b11011111, 8);

cpld_jtag_release(&jtag_cpld);

return idcode;

}
static bool portapack_detect(void) {

return jtag_pp_idcode() == 0x020A50DD;   

//i change this code to "return jtag_pp_idcode() >0;" to support
//Portapack H2 TQFP100 v3.6pcb fix fw v1.4.2
}

static const portapack_t portapack_instance = {
};

static const portapack_t* portapack_pointer = NULL;

const portapack_t* portapack(void) {

return portapack_pointer;

}

void portapack_init(void) {

if( portapack_detect() ) {
    portapack_if_init();
    portapack_lcd_reset();
    portapack_lcd_init();
    portapack_pointer = &portapack_instance;
} else {
    portapack_pointer = NULL;
}

}

标签:none

添加新评论