

#pragma once
#include "stdint.h"

#if !defined WRITABLE_TABLE
#define CONST_ATTR const
#endif


// values multiplied by 10 in lookup table
#define TIMING_SCALE 10
// number of RPM lookup values
#define MAX_RPM_POINTS 8
// number of vacuum lookup points
#define MAX_VACUUM_POINTS 8
// integer scaling factor for use with interpolation
#define INTERP_SCALE 256


// no given data
#define NO_DATA -1

#if defined __cplusplus
extern "C"
{
#endif

    // Define a set of values to be held in the table
    typedef struct
    {
        // row of column headings
        int16_t rpmMap[MAX_RPM_POINTS];
        // column of row headings - in 1000-pressure
        int16_t vacuumMap[MAX_VACUUM_POINTS];
        // Actual map values
        uint8_t mapping[MAX_VACUUM_POINTS][MAX_RPM_POINTS];
    } timingTable_t;

    extern timingTable_t CONST_ATTR baseTimingMap;
    

#if defined __cplusplus
}
#endif
