|
@@ -26,17 +26,19 @@
|
|
|
* struct timer timer;
|
|
* struct timer timer;
|
|
|
* };
|
|
* };
|
|
|
*
|
|
*
|
|
|
- * static void register_timer(struct timer *timer)
|
|
|
|
|
- * {
|
|
|
|
|
- * //...
|
|
|
|
|
- * }
|
|
|
|
|
- *
|
|
|
|
|
* static void my_timer_callback(struct timer *timer)
|
|
* static void my_timer_callback(struct timer *timer)
|
|
|
* {
|
|
* {
|
|
|
* struct info *info = container_of(timer, struct info, timer);
|
|
* struct info *info = container_of(timer, struct info, timer);
|
|
|
* printf("my_stuff is %u\n", info->my_stuff);
|
|
* printf("my_stuff is %u\n", info->my_stuff);
|
|
|
* }
|
|
* }
|
|
|
*
|
|
*
|
|
|
|
|
+ * static void register_timer(struct timer *timer)
|
|
|
|
|
+ * {
|
|
|
|
|
+ * (void)timer;
|
|
|
|
|
+ * (void)my_timer_callback;
|
|
|
|
|
+ * //...
|
|
|
|
|
+ * }
|
|
|
|
|
+ *
|
|
|
* int main(void)
|
|
* int main(void)
|
|
|
* {
|
|
* {
|
|
|
* struct info info = { .my_stuff = 1 };
|
|
* struct info info = { .my_stuff = 1 };
|