摘要: 列一个我在工作上写的代码片段, 下面是消费者端的代码 static void input_status_report_thread(struct local_pthread_wrapper* thread, void* param) { struct input_manager *input = N 阅读全文
posted @ 2020-10-03 23:40 一匹夫 阅读(210) 评论(0) 推荐(0) 编辑
摘要: # i2c_add_driver和i2c_new_device匹配后调用i2c_probe i2c控制器被注册为Platform设备。 # 启动开发板,在超级终端中输入命令“cat /proc/misc”也可以查看对应的杂项设备。 前面介绍过主设备号只有 256 个,而设备又非常多,所以引入了子设备 阅读全文
posted @ 2020-10-03 22:56 一匹夫 阅读(270) 评论(0) 推荐(0) 编辑
摘要: . class Myclass { public: virtual int FuncX(); virtual int FuncY(); }; int main() { Myclass obj; // 编译报错 cout << "hello" << endl; return 0; } class My 阅读全文
posted @ 2020-10-03 22:33 一匹夫 阅读(310) 评论(0) 推荐(0) 编辑
摘要: const int f[10] = { 1,2,3,4,5,6,7,8,9,10 }; int main() { // test1 const int i = 3; int& j = const_cast<int&>(i); // 使用const_cast关键字进行强制类型转换 j = 5; // 阅读全文
posted @ 2020-10-03 21:22 一匹夫 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 1. 多态初体验 #include <iostream> #include <string> using namespace std; class Parent { public: virtual void print() { cout << "I'm Parent." << endl; } }; 阅读全文
posted @ 2020-10-03 20:43 一匹夫 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 1. 重载指针访问符 初体验 #include <iostream> using namespace std; class test { public: test(int input) :num(input), j(input) {} ~test() {} int operator * () con 阅读全文
posted @ 2020-10-03 17:42 一匹夫 阅读(149) 评论(0) 推荐(0) 编辑