diff --git a/src/stock.cpp b/src/stock.cpp index 547d120..2e923ef 100644 --- a/src/stock.cpp +++ b/src/stock.cpp @@ -126,20 +126,20 @@ void display_stock_task(void* arg) { sprintf(delta_perc, "%+0.04f%%", -100* (1 - (c / (c-d)))); // META - drawText((PANEL_RES_X - strlen(stock))/4, 8, stock, strlen(stock), d < 0 ? 0xFF : 0x00, d < 0 ? 0x00 : 0xFF, 0x00); + drawText((PANEL_RES_X - strlen(stock))/4, 8, stock, strlen(stock), d <= 0 ? 0xFF : 0x00, d < 0 ? 0x00 : 0xFF, d ? 0x00 : 0xFF); // Arrow if(d < 0) { dma_display->drawIcon(arrow_down_icon, 1, 8, 6, 8); - } else { + } else if (d > 0) { dma_display->drawIcon(arrow_up_icon, 1, 8, 6, 8); } // Delta if(display_percentage) { - drawText((PANEL_RES_X - strlen(delta_perc))/4, 16, delta_perc, strlen(delta_perc), d < 0 ? 0xFF : 0x00, d < 0 ? 0x00 : 0xFF, 0x00); + drawText((PANEL_RES_X - strlen(delta_perc))/4, 16, delta_perc, strlen(delta_perc), d <= 0 ? 0xFF : 0x00, d < 0 ? 0x00 : 0xFF, d ? 0x00 : 0xFF); } else { - drawText((PANEL_RES_X - strlen(delta))/4, 16, delta, strlen(delta), d < 0 ? 0xFF : 0x00, d < 0 ? 0x00 : 0xFF, 0x00); + drawText((PANEL_RES_X - strlen(delta))/4, 16, delta, strlen(delta), d <= 0 ? 0xFF : 0x00, d < 0 ? 0x00 : 0xFF, d ? 0x00 : 0xFF); } vTaskDelay(ALTERNATE_TIME * 1000 / portTICK_PERIOD_MS); display_percentage ^= 1;