From 4a964d7fac6633c314c31e2089cc8cf6317dfec9 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Tue, 18 Feb 2020 06:53:56 -0600 Subject: [PATCH] Change RIG_MODEL_NUMBER macro to use 1000 multiplier instead of 100 Icom is getting close to running out of numbers Change rig_model_t to uint32_t to ensure it's 32-bit --- include/hamlib/riglist.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index 592381c42..430824c44 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -23,8 +23,13 @@ #ifndef _RIGLIST_H #define _RIGLIST_H 1 -#define RIG_MAKE_MODEL(a,b) ((a)*100+(b)) -#define RIG_BACKEND_NUM(a) ((a)/100) +// The rig model number is designed to fit in a 32-bit int +// As of 2020-02-18 we have 33 backends defined +// With a max of 1000 models per backend we get total a model number range of 1001-33001 +// This MAX was 100 prior to 2020-02-18 and Icom was close to running out of the 100 range +#define MAX_MODELS_PER_BACKEND 1000 +#define RIG_MAKE_MODEL(a,b) ((a)*MAX_MODELS_PER_BACKEND+(b)) +#define RIG_BACKEND_NUM(a) ((a)/MAX_MODELS_PER_BACKEND) /*! \file riglist.h * \brief Hamlib rig(radio) model definitions. @@ -623,7 +628,7 @@ /*! \typedef typedef int rig_model_t \brief Convenience type definition for rig model. */ -typedef int rig_model_t; +typedef uint32_t rig_model_t; /*