sparse.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 __force __attribute__((force))
  21. #undef PSTR
  22. #define PSTR(x) ((typeof(*x) __flash * __force)(x))
  23. #define to_memx(x) ((typeof(*x) __memx * __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. #endif /* __CHECKER__ */
  35. #endif /* SPARSE_H_ */