Merge pull request #9821 from cydriftcloud/send-hci-reset-after-patchram-download

PSOC6: send HCI reset after patch RAM download
pull/9842/head
Cruz Monrreal 2019-02-25 10:33:37 -06:00 committed by GitHub
commit 2b811daaf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 2 deletions

View File

@ -34,7 +34,13 @@ static const uint8_t pre_brcm_patchram_buf[] = {
0x03, 0x0C, 0x00,
0x2E, 0xFC, 0x00,
};
static const uint8_t post_brcm_patchram_buf[] = {
// RESET cmd
0x03, 0x0C, 0x00,
};
static const int pre_brcm_patch_ram_length = sizeof(pre_brcm_patchram_buf);
static const int post_brcm_patch_ram_length = sizeof(post_brcm_patchram_buf);
#define HCI_RESET_RAND_CNT 4
#define HCI_VS_CMD_SET_SLEEP_MODE 0xFC27
@ -278,12 +284,24 @@ private:
{
service_pack_ptr = brcm_patchram_buf;
service_pack_length = brcm_patch_ram_length;
service_pack_next = &HCIDriver::terminate_service_pack_transfert;
service_pack_next = &HCIDriver::post_service_pack_transfert;
service_pack_index = 0;
service_pack_transfered = false;
send_service_pack_command();
}
// Called once brcm_patchram_buf has been transferred; send post_brcm_patchram_buf
void post_service_pack_transfert(void)
{
service_pack_ptr = post_brcm_patchram_buf;
service_pack_length = post_brcm_patch_ram_length;
service_pack_next = &HCIDriver::terminate_service_pack_transfert;;
service_pack_index = 0;
service_pack_transfered = false;
wait_ms(1000);
send_service_pack_command();
}
// Called once post_brcm_patchram_buf has been transferred; start regular initialization.
void terminate_service_pack_transfert(void)
{
@ -292,7 +310,6 @@ private:
service_pack_next = NULL;
service_pack_index = 0;
service_pack_transfered = true;
wait_ms(1000);
set_sleep_mode();
}