mirror of
https://github.com/erjiang/usbscale.git
synced 2025-07-02 10:54:25 -06:00
Made the number of valid scales a defined constant
This commit is contained in:
parent
5acc91ec4f
commit
cef66896ec
6
scales.h
6
scales.h
@ -10,15 +10,15 @@
|
||||
#include <stdint.h>
|
||||
|
||||
//
|
||||
// **scalesc** should be kept updated with the length of the list.
|
||||
// **NSCALES** should be kept updated with the length of the list.
|
||||
//
|
||||
int scalesc = 3;
|
||||
#define NSCALES 3
|
||||
|
||||
//
|
||||
// Scales
|
||||
// ------
|
||||
//
|
||||
uint16_t scales[3][2] = {\
|
||||
uint16_t scales[NSCALES][2] = {\
|
||||
// Stamps.com Model 510 5LB Scale
|
||||
{0x1446, 0x6a73},
|
||||
// USPS (Elane) PS311 "XM Elane Elane UParcel 30lb"
|
||||
|
@ -364,7 +364,7 @@ static libusb_device* find_scale(libusb_device **devs)
|
||||
return NULL;
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < scalesc; i++) {
|
||||
for (i = 0; i < NSCALES; i++) {
|
||||
if(desc.idVendor == scales[i][0] &&
|
||||
desc.idProduct == scales[i][1]) {
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user