A client can decide to reset us if we fail to reply to USB messages
appropriately while doing the 1-Wire bits for temperature retrieval.
This may leave us in the state were we have a message ready to go,
but the client isn't going to read it. If we see a USB reset, reset
our state and clear any indication that we have a message to go.
#ifndef __ASSEMBLER__
void calibrateOscillatorASM(void);
-#define USB_RESET_HOOK(resetStarts) if(!resetStarts){ calibrateOscillatorASM();}
+void hadUsbReset(void);
+#define USB_RESET_HOOK(resetStarts) if(!resetStarts){ calibrateOscillatorASM(); hadUsbReset();}
#endif
/* This function calibrates the RC oscillator so that the CPU runs at F_CPU.
* It MUST be called immediately after the end of a USB RESET condition!
return 0;
}
+void hadUsbReset(void)
+{
+ /* Reset our state machine back to having nothing to send */
+ temp_state = 0;
+ have_temp_int = false;
+}
+
int main(void)
{
unsigned char i;