In any prosecution for any violation of this Act, it shall be an affirmative defense that the substance possessed by the defendant was regulated as a controlled substance under the Illinois Controlled Substances Act. In order to raise this affirmative defense, the defendant shall give notice thereof to the State not less than 7 days prior to trial.
720 ILCS 550/16.1