mem2->prev = ptr;#ifdefRT_USING_MEMTRACErt_smem_setname(mem2," ");#endif/* RT_USING_MEMTRACE *///设置当前信息块的下一个为pt2/* and insert it between mem and mem->next */mem->next = ptr2;//如果不是初始时候的第一块那需要把end of heap的pre指向ptr2if(mem2->next != small_...
rt_smem_init小内存管理算法初始化:rt_smem_t rt_smem_init(const char *name, void *begin_addr, rt_size_t size){ struct rt_small_mem_item *mem; struct rt_small_mem *small_mem; rt_ubase_t start_addr, begin_align, end_align, mem_size; small_mem = (struct rt_small_mem *)RT_...
system_heap = rt_smem_init(_name, _start, _size)#define _MEM_MALLOC(_size)rt_smem_alloc(...
用户态只要获取到 framebuffer 就可以进行对 lcd 进行操作了。 值得注意的是,在用户态我们不能直接使用 RTGRAPHIC_CTRL_GET_INFO 返回的 framebuffer 变量,而是需要使用 FBIOGET_FSCREENINFO 得到 smem_start (地址空间的起始地址),因为分配地址空间的起始地址与长度将会被填充到 fb_fix_screeninfo 结构的 smem_star...
Expand Down Expand Up @@ -213,8 +215,8 @@ rt_smem_t rt_smem_init(const char *name, /* point to begin address of heap */ small_mem->heap_ptr = (rt_uint8_t *)begin_align; RT_DEBUG_LOG(RT_DEBUG_MEM, ("mem init, heap begin address 0x%x, size %d\n", (rt_ubase_t)small...
pix_tmp=*((uint16_t*)finfo->smem_start+(y-1+vinfo->yres)*LCD_WIDTH+vinfo->xres+x); buffer[i]=pix_tmp; buffer[i+1]=pix_tmp>>8; i+=2; } else { printf("error: no support this formatn"); return-1; } } } /* TODO flush */ ...
于是,我们就可以通过向 smem_start 地址中填充颜色数据的方式让 lcd 显示各种颜色了。 5.2、触摸接口 触摸接口需要关注的文件是 lv_port_indev.c 文件,主要通过 rt_device_find 查找 touch 设备,找到设备后可以通过 device 句柄来操作 touch 设备。 1#definePOINT_NUMBER 1 ...
这部分我们可以参考 qemu-vexpress-a9 中 drv_clcd.c 的实现方法。在用户态,要是想获取并操作 lcd,驱动至少需要实现:drv_clcd_init + drv_clcd_control两个 ops 函数。 在drv_clcd_control中,我们需要对以下几种 cmd 进行处理: RTGRAPHIC_CTRL_RECT_UPDATE:通知更新图形设备 ...
Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filt...
void *rt_smem_alloc(rt_smem_t m, rt_size_t size) { rt_size_t ptr, ptr2; struct rt_small_mem_item *mem, *mem2; struct rt_small_mem *small_mem; if (size == 0) return RT_NULL; RT_ASSERT(m != RT_NULL); RT_ASSERT(rt_object_get_type(&m->parent) == RT_Object_Class_...