(a)
A person cannot be tried or adjudged to punishment or have his or her probation, mandatory supervision, postrelease community supervision, or parole revoked while that person is mentally incompetent. A defendant is mentally incompetent for purposes of this chapter if, as a result of mental disorder or developmental disability, the defendant is unable to understand the nature of the criminal proceedings or to assist counsel in the conduct of a defense in a rational manner.
(b)
Section 1370 shall apply to a person who is charged with a felony or alleged to have violated the terms of probation for a felony or mandatory supervision and is incompetent as a
result of a mental disorder. Section 1370.01 shall apply to a person who is charged with a misdemeanor or misdemeanors only, or a violation of formal or informal probation for a misdemeanor, and the judge finds reason to believe that the defendant is mentally disordered, and may, as a result of the mental disorder, be incompetent to stand trial. Section 1370.1 shall apply to a person who is incompetent as a result of a developmental disability and shall apply to a person who is incompetent as a result of a mental disorder, but is also developmentally disabled. Section 1370.02 shall apply to a person alleged to have violated the terms of his or her postrelease community supervision or parole.