Fixes: 62f3fb4ce5: fix(kernel)/improve(utest):fix the legacy issue related to the length of the object name version #10537
After this patch, if length of object name exceeds (RT_NAME_MAX - 1),
RTT will assert and oops when runing, but not in period of building.
Though I don't think it's a good solution, but don't want to argue more
about this.
Old RT_NAME_MAX is 8 for k230, and some object names, such as
"hwtimer0", which name length is 8, breaking the new rule.
Just update configuration of k230 bsp and increase RT_NAME_MAX from
8 to 16, which should be long enough for k230.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
This commit introduces the PDMA (Peripheral DMA) driver for K230 SoC,
providing essential DMA capabilities for peripheral data transfers.
Key features implemented:
1. PDMA channel request/release management
2. Channel start/stop control
3. Interrupt callback registration
4. Data transfer between device ports and DDR memory
The driver includes:
- Core driver implementation (drv_pdma.c/h)
- Build system support (SConscript)
- Basic test cases (test_pdma.c)
Tested with:
- PDMA channel request/release
- DDR to UART TX FIFO transfers
- UART RX FIFO to DDR transfers
Signed-off-by: eatvector <2302147681@qq.com>
fixed: b084503b6d "[kernel] add UP scheduler critical switch flag."
After this commit, doxygen build with warning:
include/rtthread.h:658: warning: argument 'lock' from the argument list of rt_spin_unlock has multiple @param documentation sections
include/rtthread.h:660: warning: argument 'lock' from the argument list of rt_spin_unlock_irqrestore has multiple @param documentation sections
include/rtthread.h:660: warning: argument 'level' from the argument list of rt_spin_unlock_irqrestore has multiple @param documentation sections
Rootcasue analysis:
src/cpu_up.c and src/cpu_mp.c define two identical functions.
Because the INPUT parameter in the documentation/Doxyfile currently
compiles all source files under ./src, i.e both of them, Doxygen
automatically merges the Doxygen comments for identically named
functions if it finds the content of doxygen comments different,
resulting in multiple @param.
Previously, the API comments in both files were identical, so there
was no problem. However, the b084503b6d change only modified the
comments in src/cpu_up.c but not in src/cpu_mp.c, causing problems.
Another drawback of the b084503b6d change is that Doxygen recommends
a single line for the @brief; multiple lines are not recommended.
Solution:
Given the requirement for a single line for the @brief, this issue
is relatively simple to resolve: simply list the extra content as @note.
Regarding the warning: A perfect solution has not yet been found.
One possible approach is to write a single Doxygen comment for a kernel
API with two implementations. This approach involves writing Doxygen
comments in only one file, such as src/cpu_up.c , while omitting them
in src/cpu_mp.c .
Another solution is to add API comments to include/rtthread.h , but the
RT-Thread include/rtthread.h file is already quite large, and adding
comments there would be even more cumbersome.
A temporary solution currently in use is to ensure that the Doxygen
comments for the same API are identical in both src/cpu_up.c and
src/cpu_mp.c . This ensures that Doxygen compilation does not
generate warnings, and the files are automatically merged into a
single file in the HTML document.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
In the serial ISR (`rt_hw_serial_isr`), the previous logic for handling a full RX FIFO was flawed. When the buffer was filled, it would increment `get_index` (`get_index += 1`).
This had two negative consequences:
1. It effectively discarded the oldest byte of data prematurely.
2. It reduced the usable capacity of a buffer of size N to N-1. For example, a 64-byte buffer could only ever hold 63 readable bytes after becoming full.
This patch corrects the behavior by implementing a standard overwriting ring buffer strategy. When the buffer is full, the logic is changed to `get_index = put_index`.
This ensures that:
- When new data arrives, it correctly overwrites the oldest data.
- The `get_index` is advanced along with the `put_index`, correctly marking the new start of the buffer.
- The full N-byte capacity of the buffer is utilized, always storing the N most recent bytes.
This change resolves the unexpected data loss and makes the buffer behavior correct and predictable.
* [bugfix][component/dfs]1.Skip the trailing slash character failed. 2. Scenario that parent path is root is not considered.
* replace strdup() by rt_strdup().
* free memory after strdup().
* fix issue of not appending '\0' at end when parent path is root.
* rk3566 bsp:
* Add RK3566 Code (Forked from rt-thread/tree/master/bsp/rockchip/rk3500).
* Added to the original RK3566 documentation, more detailed usage instructions.
Signed-off-by: lipeng <lipeng.git@qq.com>
Added a PWM driver and a test file test_pwm.c.
The test uses PWM to control the LED brightness,
to check if the driver works correctly.
Signed-off-by: XU HU <1337858472@qq.com>
For "RT-Thread User Guide":
Take the "RT-Thread Kernel Object Model" sub-section out of
the "Kernel Basics" section and rename it to "Object Management".
Correspondingly, rename the "Kernel Object Management" section
in the "RT-Thread API Guide" to "Object Management".
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Problen:
Duplicated definition of group_clk in clk.c and clk.h.
Solution:
Delete the definition in clk.c and keep only the definition
in clk.h.
Also change the name of group_clk to group_driver_clock to
conform to the naming convention of other driver groups.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>