Skip to content

Commit e709711

Browse files
authored
Merge pull request #49 from RT-Thread/master
update
2 parents bb848db + 0949986 commit e709711

File tree

8 files changed

+27
-145
lines changed

8 files changed

+27
-145
lines changed

bsp/stm32/stm32l475-atk-pandora/board/ports/drv_lcd.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,18 +446,33 @@ void lcd_draw_line(rt_uint16_t x1, rt_uint16_t y1, rt_uint16_t x2, rt_uint16_t y
446446
if (y1 == y2)
447447
{
448448
/* fast draw transverse line */
449-
lcd_address_set(x1, y1, x2, y2);
449+
rt_uint32_t x_offset = 0;
450+
if (x1 < x2)
451+
{
452+
x_offset = x2 - x1;
453+
lcd_address_set(x1, y1, x2, y2);
454+
}
455+
else if (x1 > x2)
456+
{
457+
x_offset = x1 - x2;
458+
lcd_address_set(x2, y2, x1, y1);
459+
}
460+
else
461+
{
462+
lcd_draw_point(x1, y1);
463+
return;
464+
}
450465

451466
rt_uint8_t line_buf[480] = {0};
452467

453-
for (i = 0; i < x2 - x1; i++)
468+
for (i = 0; i < x_offset; i++)
454469
{
455470
line_buf[2 * i] = FORE_COLOR >> 8;
456471
line_buf[2 * i + 1] = FORE_COLOR;
457472
}
458473

459474
rt_pin_write(LCD_DC_PIN, PIN_HIGH);
460-
rt_spi_send(spi_dev_lcd, line_buf, (x2 - x1) * 2);
475+
rt_spi_send(spi_dev_lcd, line_buf, x_offset * 2);
461476

462477
return ;
463478
}

src/clock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
* 2010-07-13 Bernard fix rt_tick_from_millisecond issue found by kuronca
1414
* 2011-06-26 Bernard add rt_tick_set function.
1515
* 2018-11-22 Jesven add per cpu tick
16-
* 2020-12-29 Meco Man add function rt_tick_get_millisecond()
16+
* 2020-12-29 Meco Man implement rt_tick_get_millisecond()
17+
* 2021-06-01 Meco Man add critical section projection for rt_tick_increase()
1718
*/
1819

1920
#include <rthw.h>

src/idle.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,14 @@ static void rt_thread_idle_entry(void *parameter)
202202
{
203203
#ifdef RT_USING_IDLE_HOOK
204204
rt_size_t i;
205+
void (*idle_hook)(void);
205206

206207
for (i = 0; i < RT_IDLE_HOOK_LIST_SIZE; i++)
207208
{
208-
if (idle_hook_list[i] != RT_NULL)
209+
idle_hook = idle_hook_list[i];
210+
if (idle_hook != RT_NULL)
209211
{
210-
idle_hook_list[i]();
212+
idle_hook();
211213
}
212214
}
213215
#endif

src/ipc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
* 2020-10-11 Meco Man add value overflow-check code
4040
* 2021-01-03 Meco Man implement rt_mb_urgent()
4141
* 2021-05-30 Meco Man implement rt_mutex_trytake()
42-
* 2021-01-20 hupu fix priority inversion bug of mutex
4342
*/
4443

4544
#include <rtthread.h>

src/mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void rt_system_heap_init(void *begin_addr, void *end_addr)
250250
rt_mem_setname(heap_end, "INIT");
251251
#endif
252252

253-
rt_sem_init(&heap_sem, "heap", 1, RT_IPC_FLAG_FIFO);
253+
rt_sem_init(&heap_sem, "heap", 1, RT_IPC_FLAG_PRIO);
254254

255255
/* initialize the lowest-free pointer to the start of the heap */
256256
lfree = (struct heap_mem *)heap_ptr;

src/memheap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ rt_err_t rt_memheap_init(struct rt_memheap *memheap,
155155
item->next_free = item->prev_free = RT_NULL;
156156

157157
/* initialize semaphore lock */
158-
rt_sem_init(&(memheap->lock), name, 1, RT_IPC_FLAG_FIFO);
158+
rt_sem_init(&(memheap->lock), name, 1, RT_IPC_FLAG_PRIO);
159159

160160
RT_DEBUG_LOG(RT_DEBUG_MEMHEAP,
161161
("memory heap: start addr 0x%08x, size %d, free list header 0x%08x\n",

src/slab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ void rt_system_heap_init(void *begin_addr, void *end_addr)
363363
npages = limsize / RT_MM_PAGE_SIZE;
364364

365365
/* initialize heap semaphore */
366-
rt_sem_init(&heap_sem, "heap", 1, RT_IPC_FLAG_FIFO);
366+
rt_sem_init(&heap_sem, "heap", 1, RT_IPC_FLAG_PRIO);
367367

368368
RT_DEBUG_LOG(RT_DEBUG_SLAB, ("heap[0x%x - 0x%x], size 0x%x, 0x%x pages\n",
369369
heap_start, heap_end, limsize, npages));

tools/formatting.py

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)