Advertisement
Guest User

sunxi_tp_temp.c

a guest
Aug 6th, 2015
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <sys/mman.h>
  2. #include <sys/types.h>
  3. #include <sys/stat.h>
  4. #include <errno.h>
  5. #include <fcntl.h>
  6. #include <unistd.h>
  7. #include <string.h>
  8. #include <stdlib.h>
  9. #include <stdio.h>
  10. #include <time.h>
  11. #include <math.h>
  12. #include "mod_mmio.h"
  13.  
  14. int main(int argc, char **argv)
  15. {
  16.  
  17. int opt ;
  18. int adj = 0 ;
  19. int tempoffset = 0 ;
  20.  
  21. adj = atoi(argv[1]) ;
  22. tempoffset = atoi(argv[2]) ;
  23.  
  24. mmio_write(0x01c25000, 0x0027003f) ;
  25. mmio_write(0x01c25010, 0x00040000) ;
  26. mmio_write(0x01c25018, 0x00010fff) ;
  27. mmio_write(0x01c25004, 0x00000090) ;
  28.  
  29. printf("%0.1f",(float)((mmio_read(0x01c25020)*tempoffset)-adj)/1000) ;
  30. printf("\n");
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement