sparse.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef SPARSE_H_
  2. #define SPARSE_H_
  3. #ifdef __CHECKER__
  4. /* Dummy declarations for sparse checker. */
  5. #define __flash1 __attribute__((address_space(1)))
  6. #define __flash2 __attribute__((address_space(2)))
  7. #define __flash3 __attribute__((address_space(3)))
  8. #define __flash4 __attribute__((address_space(4)))
  9. #define __flash5 __attribute__((address_space(5)))
  10. #define __flash __attribute__((address_space(6)))
  11. #define __memx __attribute__((address_space(7)))
  12. #define __ATTR_PROGMEM__ __flash
  13. #define __OS_main__ dllexport
  14. #define __builtin_avr_delay_cycles(x)
  15. #define _SYS_CDEFS_H /* Suppress system cdefs.h */
  16. #include <stddef.h>
  17. #include <stdint.h>
  18. #include <stdio.h>
  19. #include <avr/pgmspace.h>
  20. #define _cast_force __attribute__((force))
  21. #undef PSTR
  22. #define PSTR(x) ((typeof(*x) __flash * _cast_force)(x))
  23. #define to_memx(x) ((typeof(*x) __memx * _cast_force)(x))
  24. #undef FDEV_SETUP_STREAM
  25. #define FDEV_SETUP_STREAM(p, g, f) {}
  26. typedef int32_t __int24;
  27. typedef uint32_t __uint24;
  28. extern void _delay_us(double x);
  29. extern void _delay_ms(double x);
  30. extern void _delay_loop_1(uint8_t x);
  31. extern void _delay_loop_2(uint16_t x);
  32. #else /* __CHECKER__ */
  33. #define to_memx(x) (x)
  34. #define _cast_force /* nothing */
  35. #endif /* __CHECKER__ */
  36. #endif /* SPARSE_H_ */