We split the history handling form the key handling. So we could handle
the direction key even if the history is disabled. As a "side effect", I
also remove the unnecessary "use_history" bit.
Real-YModem implemented a flexible YModem support. It use callback-based
structure to let the user application to deal with the data. It contains
3 examples:
1. echo.c: write the data recieved on YModem to an other device
2. null.c: discard the YModem data
3. tofile.c: write the data to the file system
Currently, it does not support batch file transmission.
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.
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.
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.
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.
Some reader(FinSh again) would like to block on a semaphore which is
released in rx_indicate. So we should invoke rx_indicate in
_rt_pipe_resume_reader.
The previous implementation will always blocks the reader/writer.
However, at least FinSh would expect the device to be nonblocking ---
read should return 0 when there is no data in it.
RT_RINGBUFFER_SIZE could mean "the size of the whole buffer", "the size
of the empty space" or "the size of the data". Moreover, it's never a
micro anymore. Change it to rt_ringbuffer_data_len before it's too late.
Also, RT_RINGBUFFER_EMPTY is changed to rt_ringbuffer_space_len.
This provide the possibility that allocate the buffer of the ringbuffer
on a specific region, instead of always mallocing it. It also bring us
the benefit of using pipe device on the systems without heap.
Logtrace is a component that could output the log into either a device
or a file. It has the ability to filter the log messages according to a
pre-module level. Define RT_USING_LOGTRACE in rtconfig.h if you want to
have a try.
When the core received an USB_MSG_PLUG_OUT event, it will stop all the
classes. This make a chance that the classes could get rid off doing
useless stuff while the USB cable is plugged out.
When the USB got RESET packet from the host and the address is setup,
all the classes will got reset. The reset is done by class stop and than
class run. So the classes should reset their internal state in
class_{run,stop}.
Besides, the USB device driver could post a USB_MSG_RESET message on
every RESET packet.
Although currently the only message send to the queue is struct
udev_msg, in order to keep backward compacity and for extention in the
future, we set the size of message to 32.
It also add two configurations for the USB device even loop thread:
RT_USBD_THREAD_STACK_SZ to set the stack size, default to 2048
RT_USBD_THREAD_PRIO to set the priority, default to 8
You can overwrite the default values in rtconfig.h
We start the sending transaction in SOF handler. But if the data is
already sending, start an other transaction will cause data lose.
Implement a state machine is cdc_vcom and avoid that.