Changeset - 58f85a2f51f0
[Not reviewed]
cortex-f0
0 1 0
Ethan Zonca - 10 years ago 2015-03-29 22:13:29
ez@ethanzonca.com
Remove wait on USB busy. Note that previous commit introduced a fairly nasty bug where displayed temp is only updated if USB CDC is connected
1 file changed with 1 insertions and 1 deletions:
main.c
1
1
0 comments (0 inline, 0 general)
main.c
Show inline comments
 
@@ -306,49 +306,49 @@ void process()
 
            char tempstr[6];
 
            itoa(ssr_output, tempstr, 10);
 
            ssd1306_DrawString(tempstr, 0, 90);
 
 
            HAL_GPIO_WritePin(SSR_PIN, 1);
 
            last_ssr_on = ticks;
 
        }
 
    }
 
    
 
    // Kill SSR after elapsed period less than SSR_PERIOD 
 
    if(ticks - last_ssr_on > ssr_output || ssr_output == 0)
 
    {
 
        HAL_GPIO_WritePin(SSR_PIN, 0);
 
    }
 
 
    if(ticks - last_vcp_tx > VCP_TX_FREQ)
 
    {
 
        // Print temp to cdc
 
        char tempstr[16];
 
        itoa_fp(status.temp, status.temp_frac, tempstr);
 
        uint8_t numlen = strlen(tempstr);
 
        tempstr[numlen] = '\r';
 
        tempstr[numlen+1] = '\n';
 
 
        while(CDC_Transmit_FS(tempstr, numlen+2) == USBD_BUSY);
 
        CDC_Transmit_FS(tempstr, numlen+2);
 
       // while(CDC_Transmit_FS("\r\n", 2) == USBD_BUSY);
 
 
        last_vcp_tx = ticks;
 
    }
 
}
 
 
void save_settings()
 
{
 
/*
 
   Minimal_EEPROM_Unlock();
 
    // Try programming a word at an address divisible by 4
 
    Minimal_EEPROM_ProgramWord(EEPROM_BASE_ADDR + EEPROM_ADDR_BOOTTOBREW, boottobrew);
 
    Minimal_EEPROM_ProgramWord(EEPROM_BASE_ADDR + EEPROM_ADDR_WINDUP_GUARD, windup_guard);
 
    Minimal_EEPROM_ProgramWord(EEPROM_BASE_ADDR + EEPROM_ADDR_K_P, k_p);
 
    Minimal_EEPROM_ProgramWord(EEPROM_BASE_ADDR + EEPROM_ADDR_K_I, k_i);
 
    Minimal_EEPROM_ProgramWord(EEPROM_BASE_ADDR + EEPROM_ADDR_K_D, k_d);
 
    Minimal_EEPROM_ProgramWord(EEPROM_BASE_ADDR + EEPROM_ADDR_UNITS, temp_units);
 
    Minimal_EEPROM_Lock();
 
*/
 
}
 
 
void save_setpoints()
 
{
 
/*
0 comments (0 inline, 0 general)