BRAKE signal for ESC from FC: how?

On some balance bots with brushless sensored motors, I am using this controller:

with Pixhawk1.

The six Pixhawk1 AUX’s signals generate DIR’s and read wheel encoder signals (2+2 Hall’s), and the motors are driven (PWM’s) with MAIN1-2, so MAIN3-8 are unused.

I would like to generate BRAKE signals for the controller above (particularily this balance bot is heavy, so it will need braking on the outside). Pixhawk1 MAIN3-8 come from IOMCU, so I think they cannot be GPIO.

So I think a solution would be connecting PWM’s also to a small Arduino or similar board such that when reading them if timings are MOT_THR_MIN or close a few tenths of second it generates high level BRAKE’s, but I would appreciate other thoughts on this (use a different FC, LUA script, etc).