} m_navmode_t;
-#define DBG_SEND
-#define DBG_RECV
-
void serial1_tx_cout(uint8_t c)
{
debug_printf("%.2X ", c);
{
m_restart_t restart;
- memset(&restart,0,sizeof(m_restart_t));
+ memset(&restart, 0, sizeof(m_restart_t));
restart.start_mode = 0x03; /* COLD */
- venus634_send(M_RESTART,&restart,sizeof(m_restart_t));
+ venus634_send(M_RESTART, &restart, sizeof(m_restart_t));
return;
}
{
m_serconf_t serconf;
- memset(&serconf,0,sizeof(m_serconf_t));
+ memset(&serconf, 0, sizeof(m_serconf_t));
serconf.port = 0;
serconf.baud = 4;
serconf.update = 1;
- venus634_send(M_SERCONF,&serconf,sizeof(m_serconf_t));
+ venus634_send(M_SERCONF, &serconf, sizeof(m_serconf_t));
return;
}
-void venus634_msg_type(void)
+void venus634_msg_type(uint8_t mode)
{
m_output_t output;
- memset(&output,0,sizeof(m_output_t));
- output.msg_type = 0x02; /* binary msg */
+ memset(&output, 0, sizeof(m_output_t));
+ output.msg_type = mode;
output.attributes = 0; /* ram, init may freeze when update in flash */
- venus634_send(M_OUTPUT,&output,sizeof(m_output_t));
+ venus634_send(M_OUTPUT, &output, sizeof(m_output_t));
return;
}
{
m_rate_t rate;
- memset(&rate,0,sizeof(m_rate_t));
+ memset(&rate, 0, sizeof(m_rate_t));
rate.rate = 20;
- rate.attributes = 0; /* ram */
+ rate.attributes = 0; /* ram, init may freeze when update in flash */
- venus634_send(M_RATE,&rate,sizeof(m_rate_t));
+ venus634_send(M_RATE, &rate, sizeof(m_rate_t));
return;
}
{
m_waas_t waas;
- memset(&waas,0,sizeof(m_waas_t));
+ memset(&waas, 0, sizeof(m_waas_t));
waas.enable = 1;
- waas.attributes = 0; /* ram */
+ waas.attributes = 0; /* ram, init may freeze when update in flash */
- venus634_send(M_WAAS,&waas,sizeof(m_waas_t));
+ venus634_send(M_WAAS, &waas, sizeof(m_waas_t));
return;
}
{
m_navmode_t navmode;
- memset(&navmode,0,sizeof(m_navmode_t));
+ memset(&navmode, 0, sizeof(m_navmode_t));
navmode.navmode = 0; /* car */
- navmode.attributes = 0; /* ram */
+ navmode.attributes = 0; /* ram, init may freeze when update in flash */
- venus634_send(M_NAVMODE,&navmode,sizeof(m_navmode_t));
+ venus634_send(M_NAVMODE, &navmode, sizeof(m_navmode_t));
return;
}
{
m_nmeainterval_t nmeainterval;
- memset(&nmeainterval,0,sizeof(m_nmeainterval_t));
+ memset(&nmeainterval, 0, sizeof(m_nmeainterval_t));
/* set frequency for nmea: 1 = once every one position fix, 2 = once
* every two position fix, ... */
nmeainterval.vtg = 1; /* Course Over Ground and Ground Speed */
nmeainterval.zda = 1; /* Time & Date*/
- nmeainterval.attributes = 1; /* ram flash */
+ nmeainterval.attributes = 1; /* ram & flash */
- venus634_send(M_NMEAINTERVAL,&nmeainterval,sizeof(m_nmeainterval_t));
+ venus634_send(M_NMEAINTERVAL, &nmeainterval, sizeof(m_nmeainterval_t));
return;
}
venus634_restart();
wait_ack(M_RESTART);
- /* it seems we must wait that the GPS is restarted, else it doesn't work
- * properly */
- wait_ms(500);
-
printf_P(PSTR("binmode..."));
- venus634_msg_type();
+ venus634_msg_type(2); /* binary */
wait_ack(M_OUTPUT);
printf_P(PSTR("waas..."));