Commit ae89a659 caused a regression in the lpc176x UART handling.
After that commit the UART clock divisor would need to be 6.25 on
lpc1768 or 7.5 on lpc1769, but the code only supports whole numbers.
Set the PCLKSELx registers at startup and return to using full speed
peripheral clocks.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
On architectures that poll for irqs, check for any pending irqs prior
to checking if tasks are idle.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The timer_read_time() call can be expensive - when the next timer is
definitely pending, avoid making that call.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Implement rescheduling math using the simple 32-bit timer instead of
the Unix timespec struct. This makes the code simpler and doesn't
adversely impact the overall performance.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some bootloaders do not disable peripherals in use before jumping to the application. Reset peripherals to assure correct operation.
SIgned-off-by: Eric Callahan <arksine.code@gmail.com>
This adds hardware PWM support for STM32F1 processors.
This should also work for STM32 F0/F2/F4 processors, but I
don't have one of those to test it.
Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The lpc176x has an errata that could cause updates to PCLKSELx to not
take effect. Rework the code to use the default peripheral clock
speed (25Mhz or 30Mhz) so that this register does not need to be
updated at runtime.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rework the micro-controller command protocol so that it supports
direct communication with the serialqueue.c code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This adds new config options for fans: 'tachometer_pin' to specify the
GPIO pin, and 'tachometer_ppr' (default 2) to specify the number of
signal pulses per revolution. The rpm is also exposed by get_status for
command templates and the API server. For fast fans (at least 10000
RPM), the polling interval can be shortened using the
'tachometer_poll_interval' option.
There is a new mcu object for a generic edge counter, which repeatedly
polls a GPIO pin and periodically reports the count to the host.
Signed-off-by: Adrian Keet <arkeet@gmail.com>
* Add F429 variant; add CAN on PD0,PD1; add 25Mhx clock; move CAN1_RX from PI8 to correct position (PI9)
* Add test for STM32F429
Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
Writes over 496 bytes don't fit in a single "rpmsg" page. Request the
host limit the number of bytes outstanding to avoid getting "write:
(22)Invalid argument" errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Separate out the high-level command processing logic from the
low-level transmission code. Place the high-level code in
src/generic/canbus.c .
This also removes the CAN dependency on serial_irq.c .
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>