If a person is adjudged mentally incompetent pursuant to the provisions of this chapter, the superior court may dismiss any misdemeanor charge pending against the mentally incompetent person. Ten days notice shall be given to the district attorney of any motion to dismiss pursuant to this section. The court shall transmit a copy of any order dismissing a misdemeanor charge pursuant to this section to the community program director, the county mental health director, or the regional center director and the Director of Developmental Services, as appropriate.
Ca. Pen. Code § 1370.2