1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

7 Commits

Author SHA1 Message Date
Bogdan Marinescu
7f94e898e1 Added a function to directly specify the interrupt period 2011-10-10 01:22:56 +03:00
Bogdan Marinescu
9ded6db852 Implementing system timer capabilities
- the infinite timeout value is again represented by a special value
  (not a special timer ID), but this time it's a non-negative value
- all timers in the UART module default to the system timer
- all timers in the TMR module default to the system timer
- implemented a generic system timer mechanism that can be used in
  conjunction with a timer interrupt.
- implemented system timers on LM3S (tested) and STM32 (not tested).
  Both are based on the Cortex M3 SysTick timer.
2011-10-08 20:07:14 +03:00
Bogdan Marinescu
a6a9829ff1 Started to modify the timer infrastructure
- added explicit support for the system timer in common_tmr.c
- all the functions in the tmr module will now use the system timer
  by default (if no id is specified)
- infinite timeout will be specified by using a special timer ID
  rather than using negative timeout values (this allows the timer
  data type to be unsigned and increases the timer range)
2011-10-07 17:19:51 +03:00
Bogdan Marinescu
81e7f040fc merged remotefs_int branch on trunk, not fully tested yet 2011-01-16 00:23:19 +00:00
Bogdan Marinescu
5978c7b680 - Changed interrupt support infrastructure. No docs yet (will be added later), but check src/platform/lpc24xx/platform_int.c for a quick glimpse of the concept.
- Added direct access to interrupt flags; an interrupt doesn't have to trigger a handler anymore, its flag(s) can be checked instead (platform_cpu_get_interrupt_flag).
- Added experimental C interrupt handlers support (NOT TESTED). It can be compiled and used separately from the Lua interrupt support implementation. Hint: src/elua_int.c, elua_int_set_c_handler and elua_int_get_c_handler, also BUILD_C_INT_HANDLERS (as opposed to BUILD_LUA_INT_HANDLERS).
- Added tmr.set_match_int function that sets a match interrupt on a timer (one-shot or cyclic). Also works on virtual timers. In fact, it currently works only on virtual timers, as none of the platforms have support for this operation with hardware timers.
-Added more interrupt support functions in the CPU module.

All of the above were implemented and tested on the ELUA-PUC board, and nothing else. As a side effect, THIS COMMIT BRAKES THE STR912 PORT! The port will be modified to take advantage of the new interrupt structure soon; until then, please don't update it.
2010-11-03 23:57:27 +00:00
James Snyder
da35498b02 - ADC now runs with an interrupt handler, which manages samples from each
channel.  Smoothing support (rolling average) has been added. adcscope has
  been updated to reflect these changes, and show output from 4 channels at
  once.

- fix for typo in stm32/platform.c
2009-01-27 20:49:45 +00:00
Bogdan Marinescu
58da9ac870 - factored out common code from all backends in src/common.c
- added virtual timers (on LM3S, AVR32 and AT91SAM7 for now)
- added interrupt handling code for AT91SAM7 and AVR32
- fixed two serious bugs that prevented the eLua image to run on both STR9 and LPC2888 (linker command file issues)
- fixed line endings (DOS->UNIX) in the STM32 library files
- fixed preprocessor errors (hopefully all of them) like #if ELUA_CPU == LM3S8962
- other minor or less than minor fixes :)
2009-01-07 20:17:18 +00:00