Using software to control safety critical devices is not a good idea – unless there is some independent back-up system. That is why commercial aircraft have 3 independent computers, operating on a majority rule basis.
If I designed a regenerative braking system – should the regenerative braking fail for any reason, normal hydraulic braking would take over automatically. Perhaps Toyota needs me as a safety design consultant.
Not that the above answers your question.