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

122 Commits

Author SHA1 Message Date
Bogdan Marinescu
66975786cf Fixed error in getmindelay/getmaxdelay
Fixed an error which made the getmindelay/getmaxdelay functions
invalid (thanks to Martin for spotting this). Also refactored the
code that computes min/max delay from platform files to common code.
2011-11-28 22:58:10 +02:00
James Snyder
1b678dfea2 Merge branch 'master' into lm3s_usb_cdc 2011-11-13 17:41:23 -06:00
James Snyder
8c0f82198f Fix CRLF 2011-10-24 19:11:35 -05:00
James Snyder
b7b6a6e7eb Add build-time check for system timer for MMCFS 2011-10-21 18:15:14 -05:00
James Snyder
c4f7fe94c1 Adjust MMCFS to use the system timer 2011-10-21 18:08:43 -05:00
Bogdan Marinescu
a46cc203c8 fix timeout data type in the RFS implementation 2011-10-13 14:12:05 +03:00
Bogdan Marinescu
026f72dd46 System timer support is now optional
Since the system timer might be too demanding for some platforms
(although this isn't currently the case for any eLua plarform) it
is now optional. Any platform that implements it must define the
PLATFORM_HAS_SYSTIMER macro in its platform_conf.h
2011-10-11 13:59:02 +03:00
Bogdan Marinescu
b1b82b127e Change systimer overflow handling from timer stop to interrupt disable
When a systimer timer overflow is detected, handle it by temporarily disabling
the systimer interrupt rather than disabling the systimer completely. It gives
better accuracy and fixes some hardware-related issues on some platforms.
2011-10-11 00:44:06 +03:00
Bogdan Marinescu
7f94e898e1 Added a function to directly specify the interrupt period 2011-10-10 01:22:56 +03:00
Bogdan Marinescu
720d62909e new timer convenience function 2011-10-09 19:41:30 +03:00
Bogdan Marinescu
a9e69c72d4 Update net module with the new timer infrastructure
- change timeouts in elua_uip.c to the timer data type
- make all timer IDs in the net module default to the system timer
2011-10-08 23:24:19 +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
ccd3a9bdab update code to match std_get_func's new signature 2011-10-08 02:40:48 +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
Martin Guy
4b6096a8dc Sort out declarations of ADC commons and platform-specific functions 2011-10-05 16:08:45 +02:00
James Snyder
f9eec264db Merge branch 'master' into lm3s_usb_cdc 2011-10-04 21:24:00 -05:00
James Snyder
6f6b272fd9 Clean up CDC-USB support 2011-09-13 19:44:08 -05:00
Martin Guy
1c1a59851d Split platform_pwm_op(id, op[, data]) into four distinct functions
platform_pwm_op( id, op, data ) did four unrelated tasks, switching on the
"op" parameter:
op==PLATFORM_PWM_OP_SET_CLOCK took a frequency and returned a frequency
op==PLATFORM_PWM_OP_GET_CLOCK took nothing returned a frequency
op==PLATFORM_PWM_OP_START and _STOP both took nothing and returned nothing

this patch replaces it with:
clock = platform_pwm_set_clock( id, clock)
clock = platform_pwm_get_clock( id )
platform_pwm_start( id ) and
platform_pwm_stop( id )

with resulting clarity in the documentation and smaller, faster code.

This does not affect the Lau interface.
2011-08-02 16:15:59 +02:00
James Snyder
06fa255251 add os module for desktop builds of Lua including LuaRPC binary 2011-07-25 19:31:29 -05:00
Martin Guy
158ce167ca Split platform_adc_op() into six separate functions
Previously, you called platform_adc_op(id, OPERATION, u32 arg) to achieve
six unrelated functions with different arg types and return values:

GET_MAXVAL takes nothing and returns an ADC conversion value
SET_SMOOTHING takes a power-of-two filter length and returns nothing
SET_BLOCKING takes a boolean and returns nothing
IS_DONE takes nothing and returns a boolean
SET_TIMER takes a timer ID and returns nothing
SET_CLOCK takes a frequency in Hz and returns a frequency in Hz.

This changes these to six independent functions, each with the right
parameters and return values.

This also makes the documentation more comprehensible, saves 26 bytes of
executable code and should be very slightly faster.
2011-07-23 20:04:32 +02:00
Martin Guy
a04fcd854e MMCFS_TICK_HZ needs to be the same as VTMR_FREQ_HZ
elua_mmc.c uses the virtual timer tick to implement its timeout delays,
and needs MMCFS_TICK_HZ to have the same value as VTMR_FREQ_HZ.
This corrects the mismatch on AVR32 platforms and adds a check to
validate.h to ensure that it remains so.
2011-07-13 23:02:33 +02:00
Martin Guy
2a6131ffe6 Eliminate all TAB characters in elua-specific code files.
Tabs have been creeping in to eLua's source files, sometimes representing
2 characters, sometimes 8.  This patch replaces them all with the appropriate
number of spaces, according to the context.
This only fixes files that were written specifically for eLua, not the
manufacturers' SDK source files that were simply imported into the tree.
2011-07-05 17:17:45 +02:00
James Snyder
ef1f485db6 Use linenoise instead of readline on POSIX platforms for desktop LuaRPC 2011-06-20 18:04:53 -05:00
James Snyder
ae856ae163 add bitarray, bit and pack modules to desktop luarpc build 2011-05-02 16:46:53 -05:00
Martin Guy
c0119c0908 Revert "Allow enabling/disabling of console buffer bu changing only BUF_ENABLE_CON"
This reverts commit a836ebeaaee9b3a84096f6f72213fa4a9d9f725a.

As requested by Bogdan
2011-04-25 13:52:10 +02:00
Martin Guy
a836ebeaae Allow enabling/disabling of console buffer bu changing only BUF_ENABLE_CON
(before, you had to change BUF_ENABLE_CON and CON_BUF_SIZE in parallel).
2011-04-23 18:05:50 +02:00
Dado Sutter
8dbeb972a3 - Changing .org to .net on the Copyright notice (at least until we start using www.eluaprojec.org domain) 2011-02-07 22:45:16 +00:00
Dado Sutter
3b14f52f52 - Copyright notice on shell prompt updated to 2011
- Community page changes irrelevant here, as this content will migrate to a CMS soon
2011-02-07 20:47:11 +00:00
Bogdan Marinescu
81e7f040fc merged remotefs_int branch on trunk, not fully tested yet 2011-01-16 00:23:19 +00:00
Bogdan Marinescu
cbd00c7a20 INT_TMR_MATCH support for STR9 platforms, so far tested ONLY on virtual timers. Note that if a physical timer is allocated to virtual timers it can't be the target of INT_TMR_MATCH 2011-01-05 20:32:26 +00:00
James Snyder
a4ae2bf4fb Apply misc fixes to LuaRPC:
- prevent premature helper gc
 - replace some MYASSERT statements with standard Lua functions for arg checking
2010-12-14 01:05:52 +00:00
Dado Sutter
a148d3956e Changing eLua version for the next release (v0.8) 2010-12-11 00:24:17 +00:00
James Snyder
1059c69245 Adjust CAN module to not block when receiving messages. recv
returns nothing (3 params will be nil) if no messages are waiting.
2010-12-06 23:26:29 +00:00
Bogdan Marinescu
ebfd94eb01 linenoise support extended to the eLua shell (it can be enabled separately in platform_conf.h). Documentation updated 2010-11-17 20:21:36 +00:00
Bogdan Marinescu
772b33c975 linenoise support for eLua. linenoise is a readline replacement which makes using the Lua interpreter much easier and also adds support for saving the 'history' of lines types in the interpreter. Documentation updated. Thanks go to James for suggesting this in the first place. 2010-11-16 22:53:06 +00:00
Bogdan Marinescu
aa228cfc7c added const to elua_int_table; added hw_cli/hw_sei in cpu module; various other fixes 2010-11-13 22:36:09 +00:00
Bogdan Marinescu
6302c1524e STR9 backend modified for the new interrupt structure, the STR9 port can now be compiled fine (but the interrupts were not tested on this particular platform) 2010-11-04 22:40:09 +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
Bogdan Marinescu
78cab3b3ad - interrupt support in Lua
- ASM interrupt support for ARM targets which eliminates the need for buggy GCC __attribute__ ((interrupt ("IRQ"))) functions
- code refactoring
2010-09-26 18:54:18 +00:00
Bogdan Marinescu
ae54bffb5d further fix to romfs=compile under Win32 2010-09-15 17:15:43 +00:00
Bogdan Marinescu
6b3f038db3 added support for the I2C interface. UNTESTED, for now enabled only for the STR9 platform. Documentation will follow shortly 2010-07-21 20:21:55 +00:00
James Snyder
851f7c16ba ADC for MBED/LPC1768.
Note: MBED P15->P20 == adc dev ids 0->5
2010-07-12 20:56:54 +00:00
Dado Sutter
68bd22b9f7 - Minor doc editing
- Minor version string format change
- Version string changed "trunk pos0.7"
2010-06-25 18:51:24 +00:00
James Snyder
1667c477cf Basic support for opendir/readdir on mbed to do directory listing. 2010-03-28 04:15:19 +00:00
James Snyder
5f5e01fd3b Add support for Semihosting filesystem operations
- enable file creation, reading, writing on mbed for the built-in filesystem
- implementation currently lacks support for directory listings, this will be
  added when mbed implementation details are available.

Note: this should work with other ARM arm ports that are connected to a JTAG
debugger that implements semihosting, though I have not tested it.
2010-03-08 20:08:07 +00:00
Dado Sutter
a38076bb91 - Added copyright years to shell welcome message
- Project's reference changed to www.eluaproject.org on the same msg
2010-02-23 17:18:06 +00:00
Dado Sutter
15daebf98e - Added a Lua-like first-prompt welcome message to the eLua shell
- Main menu refactored to reduce info levels. Old "tutorials" are now part
of the "More Information" (which already contained tutorials) on eLua
Internals
- Shell help command adapted to rw filesystems addition (ls lists all files
of all filesystems)
- Minor order and name changes on main menu sub-items
- Minor refinements in some doc pages
2010-02-22 20:18:21 +00:00
Bogdan Marinescu
e7702bb0e2 Manual merge of remotefs/ into trunk. Tested with the simulator and (partially) on a ET-STM32 board. Other changes:
- FAT changed to support the new opendir/readdir/closedir mechanism, and to use lseek directly instead of ioctl (also fixed a bug in FAT's lseek that always returned 0 instead of file position).
- ET-STM32 console moved to UART2@19200bps (to allow RFS to run on UART0). If UART0 is needee for console, remember to disable RFS.
- freed 700+ bytes of RAM by changing the devman implementation to keep pointers instead of actual DM_DEVICE structures
- other minor code changes and fixes
2010-02-01 18:47:41 +00:00
James Snyder
0bb6552c73 Additional missing header. 2010-01-27 00:58:08 +00:00
James Snyder
47f9d97079 Missing platform_conf.h. 2010-01-27 00:56:17 +00:00