From 54f3d2de0b24ea5fd928df92af9cae36dbb23bbf Mon Sep 17 00:00:00 2001 From: seanavery Date: Sat, 27 Apr 2024 21:59:42 -0400 Subject: [PATCH] Remove some prints --- ch340.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ch340.cpp b/ch340.cpp index d118cb9..3bfd6f9 100644 --- a/ch340.cpp +++ b/ch340.cpp @@ -9,30 +9,27 @@ int CH340::init(int vendor, int product, int baudrate) { err = init_usb(vendor, product); if (err != 0) { - printf("error: %d \n", err); + std::cerr << "Error initializing usb: " << libusb_error_name(err) << std::endl; return err; } - printf("usb interface initialized \n"); err = handshake(); if (err != 0) { - printf("error: %d \n", err); + std::cerr << "Error during handshake: " << libusb_error_name(err) << std::endl; return err; } - printf("ch340g initialized \n"); err = set_baud(baudrate); if (err != 0) { - printf("error: %d \n", err); + std::cerr << "Error setting baudrate: " << libusb_error_name(err) << std::endl; return err; } err = up(); if (err != 0) { - printf("error: %d \n", err); + std::cerr << "Error during up: " << libusb_error_name(err) << std::endl; return err; } - printf("ch340g up \n"); return err; }