* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
complete_buffer(const char *buf, char *dstbuf, uint8_t dstsize,
int16_t *state)
{
complete_buffer(const char *buf, char *dstbuf, uint8_t dstsize,
int16_t *state)
{
printf_P(PSTR("(%d,%d,%d) "),
position_get_x_s16(&mainboard.pos),
position_get_y_s16(&mainboard.pos),
position_get_a_deg_s16(&mainboard.pos));
printf_P(PSTR("(%d,%d,%d) "),
position_get_x_s16(&mainboard.pos),
position_get_y_s16(&mainboard.pos),
position_get_a_deg_s16(&mainboard.pos));
rdline_init(&gen.rdl, write_char, valid_buffer, complete_buffer);
rdline_init(&gen.rdl, write_char, valid_buffer, complete_buffer);
rdline_newline(&gen.rdl, gen.prompt);
while (1) {
c = uart_recv_nowait(CMDLINE_UART);
rdline_newline(&gen.rdl, gen.prompt);
while (1) {
c = uart_recv_nowait(CMDLINE_UART);
continue;
ret = rdline_char_in(&gen.rdl, c);
if (ret != 2 && ret != 0) {
continue;
ret = rdline_char_in(&gen.rdl, c);
if (ret != 2 && ret != 0) {