Advertisement
Guest User

testintiiwno

a guest
Nov 25th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. void *test_init(unsigned short mode, unsigned short delay) {
  2. int tick_limit = delay * 60;
  3. int ipc_status;
  4. message msg;
  5.  
  6. unsigned long irq_set_timer = timer_subscribe_int();
  7. *vg_init(mode);
  8.  
  9. while (get_timer_counter() < tick_limit) {
  10. if (driver_receive(ANY, &msg, &ipc_status) != 0) {
  11. printf("driver_receive failed/n");
  12. continue;
  13. }
  14.  
  15. if (is_ipc_notify(ipc_status)) {
  16. switch (_ENDPOINT_P(msg.m_source)) {
  17. case HARDWARE:
  18. if (msg.NOTIFY_ARG & irq_set_timer) {
  19.  
  20. }
  21. else
  22. return -1;
  23. }
  24. break;
  25. default:
  26. break;
  27. }
  28. }
  29. else {
  30. continue;
  31. }
  32. vg_exit();
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement