Skip to content

Commit

Permalink
added fixed instrument
Browse files Browse the repository at this point in the history
  • Loading branch information
PBrunot committed Jun 15, 2024
1 parent 345a4c2 commit f4a5d10
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions software/front/US_Firmware.X/iron.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const t_IronPars NoIronPars = {
NULL
};

const t_IronPars Irons[] = {
const t_IronPars Irons[NB_IRONS] = {
{
0,
{0x1011},
Expand Down Expand Up @@ -937,9 +937,9 @@ void IronTasks(){

const char* IronDesc(UINT8 index)
{
static const char* UNKNOWN = "?\0";
static const char UNKNOWN[24] = "? ";

if (index >=0 && index < (sizeof(Irons) / sizeof(Irons[0])))
if (index >=0 && index < NB_IRONS)
return Irons[index].Name;

return UNKNOWN;
Expand Down
5 changes: 5 additions & 0 deletions software/front/US_Firmware.X/iron.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ typedef struct __PACKED {
#define SENSOR_PTC 2
#define SENSOR_NONE 255

// Total number of configured irons
#define NB_IRONS 13

#ifndef _IRON_C
#define IRON_H_EXTERN extern
#else
Expand All @@ -68,6 +71,8 @@ IRON_H_EXTERN UINT16 IronID;
IRON_H_EXTERN volatile t_IronPars IronPars;
IRON_H_EXTERN void IronInit();
IRON_H_EXTERN void IronTasks();

// Description of a given iron by its index
IRON_H_EXTERN const char* IronDesc(UINT8 index);

#undef IRON_H_EXTERN
Expand Down
6 changes: 3 additions & 3 deletions software/front/US_Firmware.X/pars.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const t_ParDef ParDef[] = {
{" CALIBRATE ", 0, 0, 0, 0, 0, 0, 0}, //16
{" INST.INFO ", 0, 0, 0, 0, 0, 0, 0}, //17
{" TEMP.STEP ", 1, 1, 25, 0, 0, 0, &ParDispTemp}, //18
{" MODEL ", 0, 0, 255, 0, 0, 0, &ParDispInstr}, //19
{" MODEL ", 0, 0,NB_IRONS, 0, 0, 0, &ParDispInstr}, //19
{" VERSION ", 0, 0, 0, 0, 0, 0, 0}, //20
};

Expand All @@ -57,13 +57,13 @@ void ParDispStr(int par, int col, int row, int num){
void ParDispInstr(int par, int col, int row, int num){
static const char* AUTO = " AUTO ";

if (num == 0)
if (num <= 0)
{
OLEDPrint68(col, row, AUTO, 6);
OLEDPrint68(col, row + 1, " ", 6);
return;
}
const char* desc = IronDesc(num - 1);
const char* desc = IronDesc(num - 1); // 24 characters
OLEDPrint68(col, row, desc, 6);
OLEDPrint68(col, row + 1, &desc[6], 6);
}
Expand Down

0 comments on commit f4a5d10

Please sign in to comment.