Ensure IR LEDs are off before reprogramming.
This commit is contained in:
parent
8fe8822db0
commit
f387b94729
4 changed files with 21 additions and 3 deletions
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
#include <SystemK.h>
|
||||
#include <IR.h>
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/rmt_tx.h>
|
||||
#include <driver/rmt_rx.h>
|
||||
|
|
@ -410,8 +411,7 @@ SystemKResult_T Prepare_Tag(void)
|
|||
KLOG_INFO(TAG, "Tag prepared (%u pulses):", Shot_Buffer->count);
|
||||
PrintPulseTrainToConsole(Shot_Buffer);
|
||||
|
||||
gpio_set_level(IR_TX_RIGHT_ENABLE, 0);
|
||||
gpio_set_level(IR_TX_LEFT_ENABLE, 0);
|
||||
Enable_IR_Transmit();
|
||||
|
||||
return SYSTEMK_RESULT_SUCCESS;
|
||||
}
|
||||
|
|
@ -429,3 +429,15 @@ SystemKResult_T Send_Tag(void)
|
|||
|
||||
return SYSTEMK_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
void Enable_IR_Transmit()
|
||||
{
|
||||
gpio_set_level(IR_TX_RIGHT_ENABLE, 0);
|
||||
gpio_set_level(IR_TX_LEFT_ENABLE, 0);
|
||||
}
|
||||
|
||||
void Disable_IR_Transmit()
|
||||
{
|
||||
gpio_set_level(IR_TX_RIGHT_ENABLE, 1);
|
||||
gpio_set_level(IR_TX_LEFT_ENABLE, 1);
|
||||
}
|
||||
|
|
@ -23,3 +23,5 @@
|
|||
#include "esp_err.h"
|
||||
|
||||
void Initialize_IR(SemaphoreHandle_t init_complete);
|
||||
void Enable_IR_Transmit();
|
||||
void Disable_IR_Transmit();
|
||||
|
|
@ -11,4 +11,5 @@ idf_component_register(
|
|||
"esp_https_ota"
|
||||
"app_update"
|
||||
"NVM"
|
||||
"IR"
|
||||
)
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <NVM.h>
|
||||
#include <IR.h>
|
||||
#include "esp_log.h"
|
||||
#include "esp_ota_ops.h"
|
||||
#include "esp_spiffs.h"
|
||||
|
|
@ -264,6 +265,8 @@ SystemKResult_T Maybe_Reprogram_From_USB(void)
|
|||
|
||||
static void Reprogramming_Task(void *pvParameters)
|
||||
{
|
||||
Disable_IR_Transmit();
|
||||
|
||||
SystemKResult_T result = Maybe_Reprogram_From_USB();
|
||||
static All_On_Data_T data;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue