Not sure if the code will come up in the abs computer or the engine main computer. Think I is correct in saying the brake pedal switch has 2 switches inside which is why it can fail in circuit but brake lights still work. I always ask about the lights un wipers working when the fault comes up as if the switch on the rear of the ignition has failed, the extra resistance across the failed contacts can cause electrical item not to work, but only when the engine is running.
If you still have the yellow hdc light coming on randomly, and the solution to get it to go out is to switch the ignition off then on again, then next item in the "chain of events" of what causes this is to change the accelerator pedal switch. This is a location sensor. Used as part of the hdc to know when to deactivate when you puts yer foot on the acc pedal. This was the final cure for mine. Few others too. If you like you could remove this and fiddle wiv it to see if you can create the fault yourself or just change it. Another cheap fix top try.