feat: load printer configuration from .env
Configure the 80 mm thermal printer (576 dots) via a committed .env file, loaded at startup with dotenvy. Real environment variables take precedence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,13 @@ struct PreviewFrame {
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
// Load `.env` before any thread starts, since it sets process variables.
|
||||
// Values already present in the real environment take precedence.
|
||||
match dotenvy::dotenv() {
|
||||
Ok(path) => eprintln!("[config INFO] Loaded {}", path.display()),
|
||||
Err(error) if error.not_found() => {}
|
||||
Err(error) => eprintln!("[config ERROR] Could not load .env: {error}"),
|
||||
}
|
||||
// One OpenCV inference thread per worker leaves CPU time for the camera/UI
|
||||
// on the dual-core kiosk instead of each model spawning two busy threads.
|
||||
core::set_num_threads(1)?;
|
||||
|
||||
Reference in New Issue
Block a user