diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -38,9 +38,8 @@ int main(void) Set_USBClock(); USB_Interrupts_Config(); - USB_Init(); - GPIO_SetBits(LED_POWER); + //USB_Init(); // freezes here... maybe clock issue? RCC_ClocksTypeDef RCC_Clocks; @@ -51,7 +50,6 @@ int main(void) GPIO_ResetBits(LED_STAT); Delay(100); - //ssd1306_Init(); //ssd1306_DrawPoint(3,3,1); //ssd1306_DrawPoint(5,5,0); @@ -60,9 +58,6 @@ int main(void) Delay(500); GPIO_ResetBits(LED_POWER); - -RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE); - init_spi(); while(1) @@ -115,7 +110,7 @@ void process() GPIO_SetBits(MAX_CS); if((!retval || (temp & 0x2) != 0)) - return; // Comms error + return; // Comms error - this is happening right now if((temp & 0x4)!= 0) return; // Open thermocouple @@ -123,6 +118,7 @@ void process() temp = (temp & 0x7FF8) >> 5; + // TODO: Add calibration offset (linear) @@ -289,7 +285,7 @@ void machine() // Something is terribly wrong - deault: + default: { state = STATE_IDLE;