// File: jkingan[P]ladyheather/heathgps.cpp
// Function: wakey_wakey()
void wakey_wakey()
{
if(PALISADE) return;
if(SV6_FAMILY) return;  //ttttt
if(sim_file) return;

   if(NO_SCPI_BREAK && (rcvr_type == SCPI_RCVR)) ; 
   else SendBreak(RCVR_PORT);

   enable_gpsd();  // gggg

   scpi_init(0);

//send_byte('#');  // for TAPR_TICC   aaaacccc

   send_byte(0x0D);        // for SCPI wakeup
   eom_flag = EOM;
   send_byte(0x0A);
   eom_flag = ADD_CHAR;
   Sleep(250);

   send_byte(0x0D);
   eom_flag = EOM;
   send_byte(0x0A);
   eom_flag = ADD_CHAR;
   Sleep(250);
////sendout(RCVR_PORT, 0, FLUSH_COM);
// drain_com_data();


// send_tsip_start(0x8E);  // init TSIP receiver to send packets
// send_byte(0xA5);
// send_byte(0x00);
// send_byte(0x55);
// send_byte(0x00);
// send_byte(0x00);
// send_tsip_end();

   if(com[RCVR_PORT].baud_rate == 115200) {  // wake up NVS_RCVR
      send_nvs_start(0x1F);   // 0x72 time message every second
      send_byte((u08) nav_rate);
      send_nvs_end();
   }

if(tsip_packets == 0) {
   send_moto_start("Bb");     // request Motorola sat visibility data
   send_byte(0);
   send_moto_end();

   send_moto_start("Wb");
   send_byte(1);              // for Jupiter-T: 0=MOTOROLA mode,  1=Jupiter-T mode
   send_moto_end();
}

   send_tsip_end();
   send_tsip_end();
   send_tsip_start(0x3C);     // request sat info
   send_byte(0x00);
   send_tsip_end();
////sendout(RCVR_PORT, 0, FLUSH_COM);

   drain_com_data();          // drain serial port data buffer

   reset_com_timer(RCVR_PORT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x16e1c5(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x109902
leaq 0x1708bc(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
jne 0x109902
jmp 0x109a70
leaq 0x16e1a7(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x109944
leaq 0x17089e(%rip), %rax    # 0x27a1b4
cmpl $0x36, (%rax)
je 0x10993f
leaq 0x170892(%rip), %rax    # 0x27a1b4
cmpl $0x33, (%rax)
je 0x10993f
leaq 0x170886(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x10993f
leaq 0x17087a(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x109944
jmp 0x109a70
leaq 0x193c55(%rip), %rax    # 0x29d5a0
cmpq $0x0, (%rax)
je 0x109956
jmp 0x109a70
movl $0xa, %edi
callq 0xb840
callq 0x96fe0
xorl %edi, %edi
callq 0x1098d0
movl $0xd, %edi
callq 0x7b210
movl $0x1, 0x2c1670(%rip)    # 0x3caff0
movl $0xa, %edi
callq 0x7b210
movl $0x0, 0x2c165c(%rip)    # 0x3caff0
movl $0xfa, %edi
callq 0xb8b0
movl $0xd, %edi
callq 0x7b210
movl $0x1, 0x2c163e(%rip)    # 0x3caff0
movl $0xa, %edi
callq 0x7b210
movl $0x0, 0x2c162a(%rip)    # 0x3caff0
movl $0xfa, %edi
callq 0xb8b0
leaq 0x263ae9(%rip), %rax    # 0x36d4c0
cmpl $0x1c200, 0x159d0(%rax) # imm = 0x1C200
jne 0x109a05
movl $0x1f, %edi
callq 0x824f0
leaq 0x170b44(%rip), %rax    # 0x27a538
cvttsd2si (%rax), %eax
movzbl %al, %edi
callq 0x7b210
callq 0x82630
cmpl $0x0, 0x2c65c0(%rip)    # 0x3cffcc
jne 0x109a41
leaq 0x7a1e1(%rip), %rdi     # 0x183bf6
callq 0x86190
xorl %edi, %edi
callq 0x7b210
callq 0x86230
leaq 0x79e50(%rip), %rdi     # 0x18387d
callq 0x86190
movl $0x1, %edi
callq 0x7b210
callq 0x86230
callq 0x82590
callq 0x82590
movl $0x3c, %edi
callq 0x824f0
xorl %edi, %edi
callq 0x7b210
callq 0x82590
callq 0x7a150
movl $0xa, %edi
callq 0x2bd30
popq %rbp
retq
nopw %cs:(%rax,%rax)