Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.96 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Is there a dummy lvalue that can be used when nothing is to be executed?
  2. void port_pin_set(const bool value, const uint8_t pin_mask)
  3. {
  4.     if (value) {
  5.         PORT |= pin_mask;
  6.     } else {
  7.         PORT &= ~pin_mask;
  8.     }
  9. }
  10.        
  11. #define PORT (P1OUT)
  12.        
  13. #define PORT ((int){0})
  14.        
  15. extern unsigned char dummy_P1OUT;
  16. #define PORT (dummy_P1OUT)
  17.        
  18. unsigned char dummy_P1OUT;
  19.        
  20. PORT &= ~pin_mask;
  21.  
  22. if (PORT & pin_mask) {
  23.     blink_led();
  24. }
  25.        
  26. #ifdef PORT
  27. #undef PORT
  28. #endif
  29.  
  30. #define PORT int x = 0; x
  31.        
  32. void port_pin_set(const bool value, const uint8_t pin_mask)
  33. {
  34. #ifdef BUILD_PORT_PIN_SET
  35.     if (value) {
  36.         PORT |= pin_mask;
  37.     } else {
  38.         PORT &= ~pin_mask;
  39.     }
  40. #endif
  41. }
  42.        
  43. #define PORT if (0) P1OUT
  44.        
  45. #define PORT (*(uint8_t*)(getenv("PATH")))
  46.        
  47. #include <stdlib.h>
  48.  
  49. #ifdef PORT
  50. #undef PORT
  51. #endif
  52.  
  53. #define SETDUMMYPORT (putenv("dummyPORT=x"))
  54. #define PORT (*(uint8_t*)(getenv("dummyPORT")))
  55.        
  56. int main(int argc, char* argv[])
  57. {
  58.     SETDUMMYPORT;
  59. }