@dhusolo said in PSON Macro not working as intended.:
Anyone have any ideas what's going on?
Your trigger macro works more or less "by accident", depending on the timing of config.g as @dc42 points out, and depending on the bouncing behaviour of your button. In addition (and as @dc42 says), you forgive the chance to check power before you turn it on, regardless of state, which, in turn, ultimately runs the config.g.
I think you should rework your macro:
wait 50-100 ms for the button to debounce, then, check its state again: if it is open, quit the macro with M99.
if ATX power is off, put it on, then, run your
config.g
else, wait another second or two (whatever you consider a long press), then check its state: if it is still pressed, turn ATX power off.
Depending on your timings (aka "button press habits"), you can add a loop to wait for the button to be released; this would then be called after steps 2. or 3., regardless of which branch you took.