Change the command dispatch and response generation so that most of
the work is done on pru0 instead of pru1. This allows more code to
fit into the limited space on pru1.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't use the sendf() macro for ack and nak messages - directly call
the command_sendf() code instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that console_get_input(), console_pop_input(),
console_get_output() and console_push_output() are local functions,
integrate them into their callers. This simplifies the code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that console_get_input(), console_pop_input(),
console_get_output() and console_push_output() are local functions,
integrate them into their callers. This simplifies the code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that console_get_input(), console_pop_input(),
console_get_output() and console_push_output() are local functions,
integrate them into their callers. This simplifies the code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Export a new console_sendf() function from the board code instead of
console_get_output() and console_push_output(). This enables more
flexibility in how the board specific code produces output.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the command_task() code from the generic code to the board
specific code. This enables more flexibility in how the board
specific code processes input.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Refactor the code so that message block framing, command parsing, and
command dispatch are distinct.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It appears this option is commonly needed on the at90usb1286 avr chip
(the printrboard requires it), so default it on.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a CONFIG_SIMULAVR option to the Kbuild menus and don't directly
prompt users for CONFIG_WATCHDOG or CONFIG_SERIAL_BAUD_U2X. The only
reason to disable these options would be if one were running on
simulavr. This simplifies the user visible menu options.
Also, only show CONFIG_CLEAR_PRESCALER for at90usb1286 chips.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The atmega328 is basically the same as the atmega168 - it just adds
some additional memory. Allow the chip to be selected during the
build.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Reorder the MCU list so that newer chips are at the top of the list.
This causes the very popular atmega2560 to be the default chip
selected.
Reorder the frequency list so that higher frequencies are at the top
of the list. Restrict the 20Mhz frequency to only chips that support
that speed. This causes the popular 16Mhz frequency to be the default
speed on AVR.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid using linker magic to define the init, task, and shutdown
functions. Instead, use the compile_time_request system. This
simplifies the build and produces more efficient code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid generating unique ids via memory locations and linker scripts.
Instead, generate them using code produced by buildcommands.py.
Utilize gcc's ability to perform static string comparisons at compile
time to produce a unique id for each unique string.
This fixes a build failure on ARM introduced in 142b92b8. It also
reduces the complexity of the build.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The gpio_out_write() and gpio_out_setup() calls will check for zero
and non-zero, so it is not necessary to explicitly convert to 0/1 in
the stepper.c code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
On some architectures, gcc will allocate a register for inline
assembler with an "m" constraint. Use "i" to avoid that.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change the range of values used for software PWM to avoid doing an
integer division in the main code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Instead of assuming the maximum PWM value is 255, export a constant
from the firmware to the host with the maximum value.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
On regular 32bit machines there is no need to implement explicit
signed conversion on 16bit integers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Introduce a new board function alloc_chunk() to allocate dynamic
memory. This allows the board code to implement memory allocations
without using the standard malloc() interface.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Detect avr gcc v4.8.1 and then disable warnings during the klipper.o
linking to suppress bogus "misspelled signal handler" warnings.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support a "make flash FLASH_DEVICE=/dev/ttyACM0" rule with the default
commands for flashing a device.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>