Merge branch 'dev' into dev
This commit is contained in:
@@ -194,7 +194,7 @@
|
|||||||
#define POWER_LIMIT_STEPS 5
|
#define POWER_LIMIT_STEPS 5
|
||||||
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100
|
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100
|
||||||
#define TEMP_uV_LOOKUP_HAKKO
|
#define TEMP_uV_LOOKUP_HAKKO
|
||||||
|
#define ACCEL_LIS_CLONE 1
|
||||||
#define HARDWARE_MAX_WATTAGE_X10 1000
|
#define HARDWARE_MAX_WATTAGE_X10 1000
|
||||||
#define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second
|
#define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second
|
||||||
#define TIP_RESISTANCE 75 // x10 ohms, 7.5 typical for ts100 tips
|
#define TIP_RESISTANCE 75 // x10 ohms, 7.5 typical for ts100 tips
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
* Author: Ralim
|
* Author: Ralim
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <array>
|
|
||||||
|
|
||||||
#include "LIS2DH12.hpp"
|
#include "LIS2DH12.hpp"
|
||||||
#include "cmsis_os.h"
|
#include "cmsis_os.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
#include <array>
|
||||||
|
|
||||||
static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
|
static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
|
||||||
{ LIS_CTRL_REG1, 0x17, 0}, // 25Hz
|
{ LIS_CTRL_REG1, 0x17, 0}, // 25Hz
|
||||||
@@ -45,15 +45,21 @@ bool LIS2DH12::detect() {
|
|||||||
// Read chip id to ensure its not an address collision
|
// Read chip id to ensure its not an address collision
|
||||||
uint8_t id = 0;
|
uint8_t id = 0;
|
||||||
if (ACCEL_I2C_CLASS::Mem_Read(LIS2DH_I2C_ADDRESS, LIS2DH_WHOAMI_REG, &id, 1)) {
|
if (ACCEL_I2C_CLASS::Mem_Read(LIS2DH_I2C_ADDRESS, LIS2DH_WHOAMI_REG, &id, 1)) {
|
||||||
|
#ifdef ACCEL_LIS_CLONE
|
||||||
return (id == LIS2DH_WHOAMI_ID) || (id == LIS2DH_CLONE_WHOAMI_ID);
|
return (id == LIS2DH_WHOAMI_ID) || (id == LIS2DH_CLONE_WHOAMI_ID);
|
||||||
|
#else
|
||||||
|
return (id == LIS2DH_WHOAMI_ID);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return false; // cant read ID
|
return false; // cant read ID
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LIS2DH12::isClone() {
|
bool LIS2DH12::isClone() {
|
||||||
|
#ifdef ACCEL_LIS_CLONE
|
||||||
uint8_t id = 0;
|
uint8_t id = 0;
|
||||||
if (ACCEL_I2C_CLASS::Mem_Read(LIS2DH_I2C_ADDRESS, LIS2DH_WHOAMI_REG, &id, 1)) {
|
if (ACCEL_I2C_CLASS::Mem_Read(LIS2DH_I2C_ADDRESS, LIS2DH_WHOAMI_REG, &id, 1)) {
|
||||||
return (id == LIS2DH_CLONE_WHOAMI_ID);
|
return (id == LIS2DH_CLONE_WHOAMI_ID);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user