Static And Automatic Methods

The declaration of crc_temp inside task generateCRC1 is illegal for the very reason you are seeing incorrect results.