---vl6180dr
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include "main.h"
|
||||
#include "i2c.h"
|
||||
|
||||
#define max_scale 3
|
||||
#define max_scale 1
|
||||
uint8_t changeScale = 0;
|
||||
#define ALLOW_DISABLE_WAF_FROM_BLUE_BUTTON 1
|
||||
#define theVL6180Dev 0x52 // what we use as "API device
|
||||
@@ -228,15 +228,31 @@ void RangeState(void) {
|
||||
}
|
||||
}
|
||||
uint32_t resetPressedMs = 0;
|
||||
uint8_t motionDetected = 0;
|
||||
__weak void proximityMessureCompleted (void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
uint8_t getRange (VL6180_RangeData_t* range)
|
||||
{
|
||||
if (Range.errorStatus == 0)
|
||||
{
|
||||
*range = Range;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
range->range_mm = -1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
void HAL_GPIO_EXTI_Rising_Callback(uint16_t GPIO_Pin)
|
||||
{
|
||||
if (GPIO_Pin == GPIO_PIN_0 && allowIT == 1)
|
||||
{
|
||||
RangeState();
|
||||
if (Range.errorStatus == 0)
|
||||
{
|
||||
__NOP();
|
||||
}
|
||||
proximityMessureCompleted();
|
||||
VL6180_ClearAllInterrupt(theVL6180Dev);
|
||||
}
|
||||
else if (GPIO_Pin == GPIO_PIN_1)
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
// Created by Professional on 7/31/2023.
|
||||
//
|
||||
|
||||
#include "vl6180_def.h"
|
||||
|
||||
#ifndef MYPROJECT_VL6180_APP_H
|
||||
#define MYPROJECT_VL6180_APP_H
|
||||
|
||||
#endif //MYPROJECT_VL6180_APP_H
|
||||
void vl6180_init (void);
|
||||
__weak void proximityMessureCompleted (void);
|
||||
uint8_t getRange (VL6180_RangeData_t* range);
|
||||
Reference in New Issue
Block a user