1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00

1020 Commits

Author SHA1 Message Date
Till Harbaum
2d484e1ead Fix missing UDP stats for sent/received packets
i just saw that the stats taking in uip is missing entries for udp
receive and
transmit.

To fix this insert a UIP_STAT after the udp_found label:

 udp_found:
 +  UIP_STAT(++uip_stat.udp.recv);

 And a UIP_STAT before the goto ip_send_nolen instruction:

 +  UIP_STAT(++uip_stat.udp.sent);
   goto ip_send_nolen;
2011-10-04 20:50:14 -05:00
Pablo Cossutta
fa335c481e lc-switch.h has typo in head protection macros
Another think: the LC-SWITCH.C has this two lines that are wrong:

Of course its a typo on the second one.

http://article.gmane.org/gmane.network.uip.user/15
2011-10-04 20:25:11 -05:00
Martin Guy
a11b839dd5 Respect the User's Guide by disabling a PWM channel before changing its params
It seemed to work just to change the PWM frequency and duty cycle on the fly
but the User's Guid says to disable itberfore doing this. So we do.
2011-10-05 02:44:47 +02:00
Martin Guy
7713a185bb Fix typo in commentary 2011-10-05 01:05:31 +02:00
Bogdan Marinescu
8839e93c16 Merge branch 'master' of github.com:elua/elua 2011-10-03 14:15:35 +03:00
Bogdan Marinescu
60d62078b7 Remove separate dependency step from Lua build system
The separate dependency generation step from the Lua build system
was not needed, now the dependencies are generated at the same time
as the object files.
2011-10-03 14:08:22 +03:00
Martin Guy
121a70b8b1 New firmware works with no delays and max speed of 50000Hz
The new LCD firmware doesn't need the caller to wait after each command:
it stretches the clock instead. Actually, it works at 68kHz too, but
there is a non-working range from 55 to 66kHz.
We set it to 50000Hz to have reliable operation and allow for clock drift.
2011-10-03 06:36:55 +02:00
Martin Guy
2c7d3a3743 Increase LCD I2C bus frequency to fit with new LCD module firmware.
The new firmware can run at up to 68kHz, so increase the I2C bus speed
to 60000Hz
2011-10-03 02:29:57 +02:00
Martin Guy
a9c7041af7 Use new hard reset command to reset LCD module.
We just changed LCD command 0 from a no-op to a speciall-recognized
hardware reset. This is essential because the LCD controller's reset line
is not connected to the AVR32's reset line, so if the AVR32 is reset,
the LCD is left in an unknown, possible unusable, state.
2011-10-03 02:14:28 +02:00
James Snyder
8f0bf4c7d2 set default MAC on soldercore 2011-09-29 15:05:24 -05:00
James Snyder
7b8642502b Fix uIP DHCP Lease Bug http://osdir.com/ml/network.uip.user/2007-12/msg00012.html 2011-09-28 17:13:42 -05:00
Martin Guy
f048bece4b Change LCD I2C slave addresses to 7C-7F
The old slave addresses, F2, F3, F6, F7 are reserved for 10-bit
I2C addressing.  This changes them to values that are least likely
to conflist with other devices: 7C-7F are registered to two LCD display
devices.
2011-09-28 20:29:37 +02:00
Martin Guy
a05c209ab2 Remove documentation for non-existent str9.rtc module 2011-09-27 15:09:11 +02:00
James Snyder
0d54061858 working PWM for SolderCore 2011-09-25 16:48:58 -05:00
Martin Guy
99f696451c Add BUILD_LUA_INT_HANDLERS to Mizar32 default build 2011-09-25 17:05:28 +02:00
Martin Guy
f6783e40ce Add math.floor() and math.ceil() identity functions to integral mathlib
In integer math, floor() and ceil() give the same value, but
having them included in the integer library as functions that return
their argument allows you more easily to write code that works unchanged
in both integer and floating point versions of Lua.
2011-09-23 17:41:24 +02:00
Martin Guy
30b4f7a6dd Insert setup delay for repeated START condition (missed from last commit) 2011-09-22 18:26:28 +02:00
Martin Guy
5d5443d67e Implement STOP and repeated START condition setup times from I2C spec.
The code for the bitbanger, taken from wikipedia, in turn taken from
http://www.nctutwt.net/wiki/doku.php?id=wiki:summer2010:i2c
does a STOP condition by raising SCL and immediately raising SDA, but
in the I2C spec, there is a minimum STOP setup time of 4ms between these
transitions (I2C spec, doc UM10204, table 6/figure 27, pp.37-38).

Similarly, a repeated START has a setup time of minimum 4.7us between
SCL going high and SDA going low, which the code did not contain.

This patch inserts these delays to conform better to the I2C spec,
even though all tested devices "seemed to work" without them.
2011-09-22 16:49:19 +02:00
James Snyder
571d9f0d6c fix adc configuration for LM3S9B/LM3S9D 2011-09-13 20:41:16 -05:00
James Snyder
6f6b272fd9 Clean up CDC-USB support 2011-09-13 19:44:08 -05:00
Martin Guy
22f08c454d Fix markup in PWM documentation 2011-09-13 19:34:27 +02:00
James Snyder
6ebaaa69b8 Initial working USB CDC support for LM3S 2011-09-06 20:05:23 -05:00
Martin Guy
ade99720cd Merge branch 'master' of github.com:elua/elua 2011-08-02 16:18:42 +02: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
ee759a1c4b fix typo in cyclic interrupt handling on stm32, don't enable interrupt by default.. require sei 2011-08-01 21:09:21 -05:00
James Snyder
e64f9ef3bb Merge branch 'master' of github.com:elua/elua 2011-08-01 20:32:16 -05:00
James Snyder
09b70330d6 fix case where intervals that are too long don't get reported 2011-08-01 20:31:30 -05:00
James Snyder
e71f6eb1ea basic working timer interrupts 2011-08-01 20:28:33 -05:00
James Snyder
8b50aca945 initial attempt at timer int support on stm32 2011-08-01 18:32:11 -05:00
Bogdan Marinescu
57e222185b added the cross compiler to the list of files ignored by git 2011-07-29 14:16:14 +03:00
Martin Guy
8f520abd16 Fix typo in I2C refman 2011-07-28 17:53:10 +02:00
Martin Guy
5868fa6c87 Merge branch 'master' of github.com:elua/elua 2011-07-28 17:52:52 +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
a3170a953d Replace tabs by spaces in uip code 2011-07-24 17:35:45 +02:00
Martin Guy
a6b5f865d5 Document the units of net timeouts (microseconds).
Also remove superfluous text (you can't specify a timeout without giving a
timer ID parameter because it comes after it).
2011-07-24 17:12:38 +02:00
Martin Guy
713cdfdd85 Fix a missed name change from "disp" to "lcd" 2011-07-24 05:07:03 +02:00
Martin Guy
778eaf38be Fix broken EVK1101 build and enable PWM and ADC on it.
ADC/PWM pin configuration taken from the circuit diagram
but not tested on real hardware.
2011-07-24 04:43:48 +02:00
Martin Guy
fe95291cdd First full version of Mizar32 LCD module driver. 2011-07-24 01:21:59 +02: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
007eada8db Remove bogus "luaopen_disp()" functions that are never called
Three modules had a bogus luaopen_disp() function that was never called.
In reality, each platform.c only uses the extern disp_map[] (or str9_pio_map[])
and does the right thing with it in luaopen_platform().

This also removes a bug (AUXLIB_DISP undefined), which prevented avr32
and str9 from compiling when optram=0
2011-07-23 19:12:54 +02:00
Martin Guy
c39d55feb8 Revert "Allow "disp" modules to compile when optram=0"
This reverts commit c027a5929391550d25e8a6c5edc0de8e46d30708.
2011-07-23 19:09:09 +02:00
Martin Guy
c027a59293 Allow "disp" modules to compile when optram=0
The AUXLIB_DISP macro is only used when optram=0.
This change lets the avr32 and str9 platform-specific modules compile
also under optram=0.
2011-07-23 18:53:11 +02:00
James Snyder
81a3f6aca2 testing newrpc implementation that doesn't require using adispatch. seems to work with peek and regular dispatch 2011-07-21 19:10:56 -05:00
James Snyder
3b91ff0c2a merge thiago's fixes with current trunk 2011-07-21 18:31:49 -05:00
James Snyder
041f745310 starting support for usb cdc for lm3s 2011-07-21 18:24:20 -05:00
Martin Guy
bb1b783037 Respect zero characters in string argument to mizar32.disp.print
and send long strings in packets of 31 characters, a limit imposed by the
LCD board's PIC's firmware.
2011-07-21 04:56:30 +02:00
Martin Guy
17f11b6163 Fix i2c.write() to treat all string arguments as strings.
Previously, with i2c.write(id, "123"), lua_isnumber would react to the numeric
string and greedily convert it to a single character '{', which made printing
digits to an I2C LCD display almost impossible.
2011-07-21 02:05:45 +02:00
Martin Guy
aa25e81cfa Merge branch 'master' of github.com:elua/elua 2011-07-20 10:52:58 +02:00
James Snyder
2796414863 add support to scons build system for updated LM3S peripheral library 2011-07-19 21:31:01 -05:00
James Snyder
928c5447bd Update LM3S driver library. Update startup code for added entries on LM3S9x targets 2011-07-19 21:24:55 -05:00