aboutsummaryrefslogtreecommitdiffstats
path: root/src/generic/timer_irq.c
Commit message (Collapse)AuthorAgeFilesLines
* command: Always pass a string to the DECL_CONSTANT() macroKevin O'Connor2019-03-171-1/+1
| | | | | | | | Make it clear that the name of the constant being defined is a string. When the value being defined is also a string, use a new DECL_CONSTANT_STR() macro. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* timer_irq: Increase maximum busy wait time to 2usKevin O'Connor2018-11-161-1/+1
| | | | | | | | | Increase the amount of time to "busy wait" in the timer dispatch loop to 2 micro-seconds. This, in practice, causes stepper step and unstep events to occur within a single hardware interrupt. Doing that helps stabilize the single active stepper performance benchmarks. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Don't shutdown on a "timer in the past" if already shutdownKevin O'Connor2017-10-121-1/+1
| | | | | | A shutdown will not help if the mcu is already in a shutdown state. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* timer_irq: Rework timer irq handler to check for tasks pendingKevin O'Connor2017-08-091-24/+14
| | | | | | | | Allow timer_dispatch_many() to run for extended periods if there are no tasks pending. This reduces the amount of lost cpu time spent entering and exiting the irq handler. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Implement generic sleep mechanism based on tasks pendingKevin O'Connor2017-08-081-16/+1
| | | | | | | | | Track when tasks are pending and spin in irq_wait() when no tasks are pending. This improves the mechanism for sleeping the processor - it's simpler for the board specific code and it reduces the possibility of the processor sleeping when tasks are busy. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Implement internal avr specific timer to handle 16bit overflowsKevin O'Connor2017-08-081-6/+0
| | | | | | | | | | Don't rely on the generic scheduler code to always have a timer no more than 1ms in the future. Instead, create an avr specific timer that will be called every 0x8000 ticks. This simplifies the generic code and it reduces the amount of code that needs to be run every millisecond. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Support adding timers to the start of timer_listKevin O'Connor2017-08-081-1/+1
| | | | | | | | If sched_add_timer() is called on a timer that would make it the new head of the list, then add it and signal the board code that the timer should be rescheduled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* irq: Support sleeping when mcu is idleKevin O'Connor2017-07-171-1/+16
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Use compile_time_request system for init, tasks, and shutdownKevin O'Connor2017-05-261-2/+2
| | | | | | | | 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>
* timer_irq: Integrate timer_try_set_next() into timer_dispatch_many()Kevin O'Connor2017-03-301-44/+25
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* timer_irq: Rename generic/timer.c to generic/timer_irq.cKevin O'Connor2017-03-301-0/+118
Rename the file to make it clear that the code is helper functions for boards with irq based timers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>