__main_register.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. The register Storage Class
  3. The register storage class is used to define local variables that should be stored
  4. in a register instead of RAM.
  5. This means that the variable has a maximum size equal to the register
  6. size (usually one word) and can't have the unary '&' operator applied to it
  7. (as it does not have a memory location).
  8. {
  9. register int miles;
  10. }
  11. The register should only be used for variables that require quick access
  12. such as counters. It should also be noted that defining 'register'
  13. does not mean that the variable will be stored in a register.
  14. It means that it MIGHT be stored in a register depending on hardware and
  15. implementation restrictions.
  16. */
  17. /*
  18. A register variable cannot be used as a "global" variable,
  19. because file scope variables have static storage,
  20. thus by definition they have an address. register variables are exactly the contrary,
  21. that are variables for which you, the programmer, promise to never take their address.
  22. So combining the two makes not much sense.
  23. BTW, the error message that you get is not very helpful.
  24. It seems that your compiler is referring to an extension that allows to fix
  25. a register variable to a particular hardware register. If you post such an error
  26. message please also give an indication which compiler and/or platform you are using.
  27. */
  28. //register ARDUINO_LOOP_LATENCY_T
  29. //register ARDUINO_LOOP_LATENCY__MAIN_A ; //EVERY 10 LOOPS INIT THIS LATENCY
  30. //register ARDUINO_LOOP_LATENCY_T ARDUINO_LOOP_LATENCY__MAIN_END_A ; //EVERY 10 LOOPS INIT THIS LATENCY
  31. //register ARDUINO_LOOP_LATENCY_COUNTER_T ARDUINO_LOOP_LATENCY_COUNTER__MAIN_END_A ;
  32. //register ARDUINO_LOOP_LATENCY_COUNTER_T ARDUINO_LOOP_LATENCY_COUNTER__MAIN_A = NULL ; //WILL decrement