register framebuffer device */
| 687 | |
| 688 | /* register framebuffer device */ |
| 689 | static int fb_init(rt_device_t fb) |
| 690 | { |
| 691 | static rt_bool_t fb_init_ok = RT_FALSE; |
| 692 | |
| 693 | if (fb_init_ok) |
| 694 | { |
| 695 | return 0; |
| 696 | } |
| 697 | RT_ASSERT(!rt_device_find("fb0")); |
| 698 | fb->type = RT_Device_Class_Miscellaneous; |
| 699 | |
| 700 | #ifdef RT_USING_DEVICE_OPS |
| 701 | fb->ops = &fb_ops; |
| 702 | #else |
| 703 | |
| 704 | fb->init = RT_NULL; |
| 705 | fb->open = fb_open; |
| 706 | fb->close = fb_close; |
| 707 | fb->read = RT_NULL; |
| 708 | fb->write = RT_NULL; |
| 709 | fb->control = fb_control; |
| 710 | fb->user_data = RT_NULL; |
| 711 | #endif |
| 712 | |
| 713 | rt_device_register(fb,"fb0",RT_DEVICE_FLAG_RDWR); |
| 714 | |
| 715 | fb_init_ok = RT_TRUE; |
| 716 | |
| 717 | return RT_EOK; |
| 718 | } |
| 719 | |
| 720 | /* set up the 'lcd_device' and register it */ |
| 721 | int rt_hw_lcd_init(void) |
no test coverage detected