// File: /workspace/github_cpp_makefile_star2_O2/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:
leaq 0x152642(%rip), %rax    # 0x2028d0
movq (%rax), %rcx
cmpq $0x1, %rcx
sete %dl
leaq 0x154d35(%rip), %rax    # 0x204fd4
movl (%rax), %eax
cmpl $0x50, %eax
sete %sil
testb %sil, %dl
jne 0xb02d4
leaq 0x17810c(%rip), %rdx    # 0x2283c0
movq (%rdx), %rdx
cmpq $0x1, %rcx
jne 0xb02d5
testq %rdx, %rdx
jne 0xb02d4
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0xb02da
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0xb02da
retq
testq %rdx, %rdx
jne 0xb02d4
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0xae2d
callq 0x65757
pushq $0xd
popq %r14
movl %r14d, %edi
callq 0x523f2
pushq $0x1
popq %r15
movl %r15d, 0x2a5b06(%rip)   # 0x355e10
movl %ebx, %edi
callq 0x523f2
andl $0x0, 0x2a5af8(%rip)    # 0x355e10
movl $0xfa, %edi
callq 0xae83
movl %r14d, %edi
callq 0x523f2
movl %r15d, 0x2a5adf(%rip)   # 0x355e10
movl %ebx, %edi
callq 0x523f2
andl $0x0, 0x2a5ad1(%rip)    # 0x355e10
movl $0xfa, %edi
callq 0xae83
leaq 0x247f90(%rip), %rax    # 0x2f82e0
cmpl $0x1c200, 0x159d0(%rax) # imm = 0x1C200
jne 0xb037c
pushq $0x1f
popq %rdi
callq 0x5707f
leaq 0x154fed(%rip), %rax    # 0x205358
cvttsd2si (%rax), %eax
movzbl %al, %edi
callq 0x523f2
callq 0x57171
cmpl $0x0, 0x2aaa79(%rip)    # 0x35adfc
jne 0xb03b6
leaq 0x5a532(%rip), %rdi     # 0x10a8be
callq 0x59a28
xorl %edi, %edi
callq 0x523f2
callq 0x59aab
leaq 0x5a1a1(%rip), %rdi     # 0x10a545
callq 0x59a28
pushq $0x1
popq %rdi
callq 0x523f2
callq 0x59aab
callq 0x570f8
callq 0x570f8
pushq $0x3c
popq %rdi
callq 0x5707f
xorl %edi, %edi
callq 0x523f2
callq 0x570f8
callq 0x519b1
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1d93f