I want to track my app by sending strings out of the UART at appropriate times. So, for example, in the once-per-second interrupt handler I want to put (and can put, and it works perfectly)
one_second_interrupt_msg: .db 10, 13, "one_second_interrupt" ,0 ldi r16, low (2*one_second_interrupt_msg) ldi r17, high (2*one_second_interrupt_msg) rcall lib_util_send_message
But then I want to put in another place
five_second_interrupt_msg: .db 10, 13, "five_second_interrupt" ,0 ldi r16, low (2*five_second_interrupt_msg) ldi r17, high (2*five_second_interrupt_msg) rcall lib_util_send_message
Now that looks like it could benefit from a macro being defined so that I could just do something like
_macro_track_app one_second_interrupt ... macro_track_app one_second_interrupt_path_2a
etc where I want and it makes it easy to sprinkle around the code as much as I like
But my macro skills are defeating me. The closest I can get is
.macro _macro_track_app @0_msg: .db 10, 13, "@0" ,0 ldi r16, low (2*@0_msg) ldi r17, high (2*@0_msg) rcall lib_util_send_message .endmacro
which all works (well, compiles) except, obviously, it prints out "@0" (no quotes) rather than the passed in value of @0.
So the bottom line is how do I get the string represented by @0 into a .db directive?...or is there some other way I can easily (minimal hand editing) do this "app tracking by serial output"?