[Core] Introduce pointing device specific debug messages (#17663)
This commit is contained in:
parent
d910e8df77
commit
e99ec28f5f
9 changed files with 50 additions and 59 deletions
|
@ -14,10 +14,10 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "pointing_device_internal.h"
|
||||
#include "pimoroni_trackball.h"
|
||||
#include "i2c_master.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "timer.h"
|
||||
|
||||
// clang-format off
|
||||
|
@ -58,20 +58,17 @@ void pimoroni_trackball_set_rgbw(uint8_t r, uint8_t g, uint8_t b, uint8_t w) {
|
|||
uint8_t data[4] = {r, g, b, w};
|
||||
__attribute__((unused)) i2c_status_t status = i2c_writeReg(PIMORONI_TRACKBALL_ADDRESS << 1, PIMORONI_TRACKBALL_REG_LED_RED, data, sizeof(data), PIMORONI_TRACKBALL_TIMEOUT);
|
||||
|
||||
#ifdef CONSOLE_ENABLE
|
||||
if (debug_mouse) dprintf("Trackball RGBW i2c_status_t: %d\n", status);
|
||||
#endif
|
||||
pd_dprintf("Trackball RGBW i2c_status_t: %d\n", status);
|
||||
}
|
||||
|
||||
i2c_status_t read_pimoroni_trackball(pimoroni_data_t* data) {
|
||||
i2c_status_t status = i2c_readReg(PIMORONI_TRACKBALL_ADDRESS << 1, PIMORONI_TRACKBALL_REG_LEFT, (uint8_t*)data, sizeof(*data), PIMORONI_TRACKBALL_TIMEOUT);
|
||||
#ifdef CONSOLE_ENABLE
|
||||
if (debug_mouse) {
|
||||
static uint16_t d_timer;
|
||||
if (timer_elapsed(d_timer) > PIMORONI_TRACKBALL_DEBUG_INTERVAL) {
|
||||
dprintf("Trackball READ i2c_status_t: %d L: %d R: %d Up: %d D: %d SW: %d\n", status, data->left, data->right, data->up, data->down, data->click);
|
||||
d_timer = timer_read();
|
||||
}
|
||||
|
||||
#ifdef POINTING_DEVICE_DEBUG
|
||||
static uint16_t d_timer;
|
||||
if (timer_elapsed(d_timer) > PIMORONI_TRACKBALL_DEBUG_INTERVAL) {
|
||||
pd_dprintf("Trackball READ i2c_status_t: %d L: %d R: %d Up: %d D: %d SW: %d\n", status, data->left, data->right, data->up, data->down, data->click);
|
||||
d_timer = timer_read();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue