From 267a3bfd1e8892f8ae75bc4b3d1a5c4b310f1805 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Fri, 13 Jul 2018 18:20:25 +0100 Subject: [PATCH] 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. --- main.c | 30 ------------------------------ 1 file changed, 30 deletions(-) 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 && -- 2.39.5