From: Jonathan McDowell Date: Fri, 13 Jul 2018 17:20:25 +0000 (+0100) Subject: Remove unused read_temp() function X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=267a3bfd1e8892f8ae75bc4b3d1a5c4b310f1805;p=temper-clone.git Remove unused read_temp() function The temperature is read as part of a state machine in the main loop so we don't tie thing up for too long, so this is no longer necessary. --- diff --git a/main.c b/main.c index de54471..bcc4008 100644 --- a/main.c +++ b/main.c @@ -221,36 +221,6 @@ void set_serial(void) } } -uint16_t read_temp(void) -{ - uint8_t buf[9]; - - cli(); - if (!w1_reset()) { - return 0xFFFF; - sei(); - } - - w1_write(0xCC); /* SKIP ROM */ - w1_write(0x44); /* Convert T */ - - do { - w1_read(buf, 1); - } while (buf[0] != 0xFF); - - if (!w1_reset()) { - return 0xFFFF; - sei(); - } - - w1_write(0xCC); /* SKIP ROM */ - w1_write(0xBE); /* Read Scratchpad */ - w1_read(buf, 9); - sei(); - - return buf[2] << 8 | buf[1]; -} - usbMsgLen_t usbFunctionDescriptor(usbRequest_t *rq) { if (rq->wValue.bytes[1] == USBDESCR_STRING &&