Commit Graph

3448 Commits

Author SHA1 Message Date
joyhope 281e55e973 notification function: rt_err_t (*tx_complete)(rt_device_t dev, void
*buffer) with buffer pointer
2013-09-24 20:57:00 +08:00
aozima cad12ee14e update rt_kprintf: make sure the device is in STREAM mode when used by rt_kprintf. 2013-09-24 15:29:08 +08:00
Bernard Xiong 0b844aa82d Merge pull request #160 from grissiom/misc-fix
logtrace: cleanup code and fix compiling warnings
2013-09-23 05:28:03 -07:00
Grissiom 2a20337707 logtrace: adjust the log values
logtrace only use odd number of log levels. So the use could set some
custom level amount them.
2013-09-23 15:13:45 +08:00
Grissiom 519982fa74 logtrace: add LOG_TRACE_VERBOSE log level 2013-09-23 15:10:02 +08:00
Grissiom 783a6a6717 logtrace: cleanup code and fix compiling warnings 2013-09-23 13:13:03 +08:00
Bernard Xiong 29871c0d84 Merge pull request #159 from grissiom/misc-fix
kservice: export vsnprintf as rt_vsnprintf
2013-09-22 21:07:20 -07:00
Grissiom 7b0a3afdf9 kservice: export vsnprintf as rt_vsnprintf
vsnprintf is a common string function that could be used in many places.
Using both vsnprintf in libc and vsnprintf in the RTT could make a
bigger image. Moreover, if newlib is not enabled when compiling with
GCC, referencing vsnprintf will lead to link error:

    .../arm-none-eabi/lib/armv7-ar/thumb/softfp/libc.a(lib_a-sbrkr.o):
    In function `_sbrk_r':
    sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
    collect2: error: ld returned 1 exit status

Using rt_vsnprintf could avoid such problem.
2013-09-23 11:34:13 +08:00
Bernard Xiong 1cb4ee74fb Merge pull request #158 from grissiom/finsh-fix
finsh: unregister rx_indicate when closing the device
2013-09-22 15:23:56 -07:00
Grissiom 6d2df9bf94 finsh: unregister rx_indicate when closing the device
Because the device could still remain opened when closed by finsh, the
old rx_indicate is useless for finsh. Some buggy driver will still
generate rx_indicate even after the device has been closed. So FinSh
should unregister the rx_indicate when releasing the old device.
2013-09-22 22:12:04 +08:00
Bernard Xiong 7bdb082c91 Delete SConscript 2013-09-22 06:59:52 +08:00
bernard 09b105ecf7 use UART0 as console 2013-09-21 17:18:45 +08:00
bernard 9d09cd9f23 Import beaglebone porting 2013-09-20 21:20:51 +08:00
bernard 0bf7ed76cf Merge branch 'master' of https://github.com/RT-Thread/rt-thread 2013-09-17 11:07:36 +08:00
bernard 77096894f9 change the compiling macro before DFS option 2013-09-17 11:07:24 +08:00
Bernard Xiong 47c152ee7f Merge pull request #156 from grissiom/fix-event_recv
rt_event_recv: add a check on the option flag
2013-09-14 19:24:38 -07:00
prife 63394f5d1b Merge pull request #155 from grissiom/simulator
Simulator
2013-09-14 08:20:28 -07:00
Grissiom c465bc2c2e rt_event_recv: add a check on the option flag
Either RT_EVENT_FLAG_AND or RT_EVENT_FLAG_OR should be set in the option
flag. If none of them is present, the waiting thread will never be
resumed.
2013-09-14 13:12:23 +08:00
Bernard Xiong 2bcb9edd91 Add gettimeofday declaration in sys/time.h 2013-09-08 15:01:29 +08:00
Grissiom dacd2cb9a9 travis: add scan-build in PATH 2013-09-07 18:31:05 +08:00
Grissiom 4240ebd73f travis: don't export RTT_CC in before_script if it's been set
This gives ways for bsp to set it's own RTT_CC.
2013-09-07 17:17:58 +08:00
Grissiom eae89b9576 travis: install the gcc-multilib to get the 32bit build OK 2013-09-07 16:15:43 +08:00
Grissiom 5ab9943eb5 travis: try to fix the SDL building 2013-09-07 16:01:03 +08:00
Grissiom 0168048f27 travis: auto build the simulator
Building is only the first step. Correctness is what we need. There are
already many GCC builds for other bsp so GCC building for simulator is
not important. So I use clang-analyze to check all the source codes in
simulator project. Hope it will help us.
2013-09-07 15:46:11 +08:00
Grissiom 35cac170fa simulator: add clang-analyze tool support
When CROSS_TOOL or 'RTT_CC' env is setted to 'clang-analyze', it will
use Clang to check the codes.
2013-09-07 15:15:48 +08:00
Grissiom c289aa9fc1 Scons: add a custom tool to do clang static analyze
Bsps can use the clang analyzer as a tool:

    env = Environment(toolpath=[os.path.join(RTT_ROOT, 'tools',
                      'tools')], tools = ['clang-analyze'])

When building the project, the static analyzer will be called to check
all the C code. The warnings are print to stderr.
2013-09-07 15:15:48 +08:00
Grissiom 3b4f3f5931 Scons: run `clang -Wall -fsyntax-only` in clang-analyze
The `clang -fsyntax-only` will give us additional warning messages in
the console.
2013-09-07 15:15:47 +08:00
Grissiom 18692c29b8 simulator: get CROSS_TOOL and EXEC_PATH from env
Simulator get it's way to Travis CI ready.
2013-09-06 21:54:27 +08:00
Grissiom c6e81b58d9 simulator: move SDL setting staff into drivers/SConstruct
This could not only make a cleaner SConstruct, but could also benefit
RTGUI building.
2013-09-06 21:49:53 +08:00
Bernard Xiong 15b9db80d6 Merge pull request #154 from grissiom/simulator
sim/posix: move rt_hw_context_switch_interrupt after it's definition
2013-09-03 22:55:17 -07:00
Grissiom 3ebc766521 sim/posix: move rt_hw_context_switch_interrupt after it's definition
This fix a compile error in Clang.
2013-09-04 00:05:03 +08:00
Bernard Xiong b4166e0b25 Merge pull request #153 from grissiom/stm32f10x
stm32f10x: fix the rtgui initialization
2013-09-03 05:46:20 -07:00
Grissiom d70761222c stm32f10x: fix the rtgui initialization
The rtgui_system_server_init prototype is wrong. And if we use
RT_USING_COMPONENTS_INIT, there is no need to call
rtgui_system_server_init again.
2013-09-03 20:09:45 +08:00
Bernard Xiong 49e28c2629 Merge pull request #152 from grissiom/log-trace
log_trace: cleanup
2013-09-03 05:00:40 -07:00
Grissiom ea66b820e1 log_trace: cleanup 2013-09-03 16:09:16 +08:00
Bernard Xiong 51ce91f30b Merge pull request #151 from grissiom/finsh
finsh: use alias in the variable definition
2013-09-02 00:12:03 -07:00
Bernard Xiong e2a0b1930b Merge pull request #150 from grissiom/simulator-linux
Simulator linux
2013-08-31 17:14:21 -07:00
Grissiom c05b205390 finsh: use alias in the variable definition
With this patch, one could define two alias for the same function like:

    FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_cpu_reset, reboot, reboot the cpu);
    FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_cpu_reset, __cmd_reboot, reboot the cpu);

Suitable for being used in MSH/Finsh.
2013-08-31 17:58:34 +08:00
Grissiom 6563ae6cab simulator: init SDL after rt_components_init
SDL may use DFS to open files. It should be run after
rt_components_init.
2013-08-31 16:46:36 +08:00
Grissiom 3d0c0af371 simulator: fix SDL initialization under Linux
rt_hw_sdl_start should wait untill the rtgui_graphic_set_device is
called int the sdl_loop. Use pthread_cond_wait to achieve this in Linux.
2013-08-31 16:30:32 +08:00
Bernard Xiong f7f14cf566 Merge pull request #146 from grissiom/rtt-next
Some fix for the portal device
2013-08-26 21:12:55 -07:00
Grissiom 246bdde8de dev/portal: fix bug in portal callback forwarding
When forwarding rx/tx callback from the underlaying device(pipe), the
"dev" argument should be the portal. So the portal callback could think
itself as called.
2013-08-22 16:43:06 +08:00
Grissiom 824261d3bc dev/portal: add checks on oflag
It does not make sense to open portal without a flag. One should open a
portal with RT_DEVICE_OFLAG_RDWR in most cases.
2013-08-22 15:12:00 +08:00
Bernard Xiong b4ba2657bb Merge pull request #145 from grissiom/hot-fix
finsh/cmd: add description for new pipe and portal device
2013-08-20 20:02:31 -07:00
Grissiom b4ab82284f finsh/cmd: add description for new pipe and portal device 2013-08-20 14:27:28 +08:00
Bernard Xiong 59f0f66996 Merge pull request #144 from grissiom/portal-device
Portal device
2013-08-19 22:41:31 -07:00
Grissiom 6e676e7754 dev/portal: implement portal device
Portal is a device that connect devices. Currently, you can only connect
pipes in portal. Pipes are unidirectional. But with portal, you can
construct a bidirectional device with two pipes.
2013-08-20 12:54:43 +08:00
Grissiom 7e68096a88 dev/pipe: make pipe a type of device
Pipe have many differences with char device. The main difference is
altough pipe have both read and write, it is unidirectional in nature.
2013-08-20 10:16:55 +08:00
Bernard Xiong a8f9f85f66 Merge pull request #143 from grissiom/ringbuffer-pipe
Ringbuffer and Pipe
2013-08-19 02:39:56 -07:00
Grissiom 0340300f89 dev/pipe: cleanup 2013-08-19 16:25:17 +08:00