Skip to content

Commit

Permalink
Merge pull request #7 from cvetaevvitaliy/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
cvetaevvitaliy authored Jun 4, 2020
2 parents 6f9caba + 5a90019 commit 4cd385a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 214 deletions.
Binary file added CLI_HID
Binary file not shown.
5 changes: 5 additions & 0 deletions Main_App/Debug.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// Created by Vitaliy on 6/4/20.
//

#include "Debug.h"
8 changes: 8 additions & 0 deletions Main_App/Debug.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Created by Vitaliy on 6/4/20.
//

#ifndef FATSHARK_POWER_V1_DEBUG_H
#define FATSHARK_POWER_V1_DEBUG_H

#endif //FATSHARK_POWER_V1_DEBUG_H
150 changes: 0 additions & 150 deletions Main_App/HDQ.c

This file was deleted.

51 changes: 0 additions & 51 deletions Main_App/HDQ.h

This file was deleted.

30 changes: 19 additions & 11 deletions Main_App/main_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
#include "Settings_Eeprom.h"
#include "HDQ.h"

#define CHECK_MIN_VOUT_8V 7

uint8_t BYT1, BYT2;
int dev, firm, hard, major, minor;
uint32_t time_delay = 0;

extern DMA_HandleTypeDef hdma_adc1;
extern I2C_HandleTypeDef hi2c1;
extern RTC_HandleTypeDef hrtc;
Expand All @@ -30,8 +24,9 @@ void App_Setup(void){
#endif
//Settings_Set_Default(&Device_Status.Device_Settings);
Settings_Get(&Device_Status.Device_Settings);
//Settings_Set_BQ27441();
//Settings_Set_Default(&Device_Status.Device_Settings);
if (Device_Status.Device_Settings.low_volt == 0xFFFF) {
Settings_Set_Default(&Device_Status.Device_Settings);
}
}

void App_Init(void){
Expand Down Expand Up @@ -157,7 +152,20 @@ static void Time_Task(Device_Status_t *Data){

static void Need_Reset(Device_Status_t *Data){

if (HAL_GPIO_ReadPin (Button1_GPIO_Port, Button1_Pin) && HAL_GPIO_ReadPin (Button2_GPIO_Port, Button2_Pin))
if (Data->ChargeChip.vbus_type == BQ2589X_VBUS_USB_SDP || Data->ChargeChip.vbus_type == BQ2589X_VBUS_USB_CDP )
NVIC_SystemReset();
if (HAL_GPIO_ReadPin (Button1_GPIO_Port, Button1_Pin) && HAL_GPIO_ReadPin (Button2_GPIO_Port, Button2_Pin)) {
if (Data->ChargeChip.vbus_type == BQ2589X_VBUS_USB_SDP || Data->ChargeChip.vbus_type == BQ2589X_VBUS_USB_CDP ) {
ssd1306_Clear();
ssd1306_Draw_String("DFU 3.0", 30, 10, &Font_8x10);
ssd1306_UpdateScreen();
uint16_t data = 0x424C;
HAL_RTCEx_BKUPWrite(&hrtc, 4, (uint32_t) data);
HAL_Delay(1000);
}
// SET_BIT(PWR->CR, PWR_CR_DBP);
//WRITE_REG(BKP->DR4, 0x424C);
//CLEAR_BIT(PWR->CR, PWR_CR_DBP);
// HAL_Delay(1000);
//if (Data->ChargeChip.vbus_type == BQ2589X_VBUS_USB_SDP || Data->ChargeChip.vbus_type == BQ2589X_VBUS_USB_CDP )
NVIC_SystemReset();
}
}
2 changes: 1 addition & 1 deletion STM32F103TBUx_FLASH.ld
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ _Min_Stack_Size = 0x600; /* required amount of stack */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
FLASH (rx) : ORIGIN = 0x8000800, LENGTH = 128K
}

/* Define output sections */
Expand Down
2 changes: 1 addition & 1 deletion Src/system_stm32f1xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
#define VECT_TAB_OFFSET 0x00000800U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */


Expand Down

0 comments on commit 4cd385a

Please sign in to comment.