Better messages flowing
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
#ifndef BSP_MINIWARE_PINS_H_
|
||||
#define BSP_MINIWARE_PINS_H_
|
||||
|
||||
#if defined(MODEL_TS100) + defined(MODEL_TS80) > 1
|
||||
#if defined(MODEL_TS100) + defined(MODEL_TS80)+defined(MODEL_TS80P) > 1
|
||||
#error "Multiple models defined!"
|
||||
#elif defined(MODEL_TS100) + defined(MODEL_TS80) == 0
|
||||
#elif defined(MODEL_TS100) + defined(MODEL_TS80)+ defined(MODEL_TS80P) == 0
|
||||
#error "No model defined!"
|
||||
#endif
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
#define SCL_GPIO_Port GPIOB
|
||||
#define SDA_Pin GPIO_PIN_7
|
||||
#define SDA_GPIO_Port GPIOB
|
||||
|
||||
#else
|
||||
#endif
|
||||
#ifdef MODEL_TS80
|
||||
// TS80 pin map
|
||||
#define KEY_B_Pin GPIO_PIN_0
|
||||
#define KEY_B_GPIO_Port GPIOB
|
||||
@@ -84,6 +84,45 @@
|
||||
#define INT_PD_Pin GPIO_PIN_9
|
||||
#define INT_PD_GPIO_Port GPIOA
|
||||
|
||||
#endif
|
||||
#ifdef MODEL_TS80P
|
||||
// TS80P pin map
|
||||
#define KEY_B_Pin GPIO_PIN_0
|
||||
#define KEY_B_GPIO_Port GPIOB
|
||||
#define TMP36_INPUT_Pin GPIO_PIN_4
|
||||
#define TMP36_INPUT_GPIO_Port GPIOA
|
||||
#define TMP36_ADC1_CHANNEL ADC_CHANNEL_4
|
||||
#define TIP_TEMP_Pin GPIO_PIN_3
|
||||
#define TIP_TEMP_GPIO_Port GPIOA
|
||||
#define TIP_TEMP_ADC1_CHANNEL ADC_CHANNEL_3
|
||||
#define TIP_TEMP_ADC2_CHANNEL ADC_CHANNEL_3
|
||||
|
||||
#define VIN_Pin GPIO_PIN_2
|
||||
#define VIN_GPIO_Port GPIOA
|
||||
#define VIN_ADC1_CHANNEL ADC_CHANNEL_2
|
||||
#define VIN_ADC2_CHANNEL ADC_CHANNEL_2
|
||||
#define OLED_RESET_Pin GPIO_PIN_15
|
||||
#define OLED_RESET_GPIO_Port GPIOA
|
||||
#define KEY_A_Pin GPIO_PIN_1
|
||||
#define KEY_A_GPIO_Port GPIOB
|
||||
#define INT_Orientation_Pin GPIO_PIN_4
|
||||
#define INT_Orientation_GPIO_Port GPIOB
|
||||
#define PWM_Out_Pin GPIO_PIN_6
|
||||
#define PWM_Out_GPIO_Port GPIOA
|
||||
#define PWM_Out_CHANNEL TIM_CHANNEL_1
|
||||
#define INT_Movement_Pin GPIO_PIN_5
|
||||
#define INT_Movement_GPIO_Port GPIOB
|
||||
#define SCL_Pin GPIO_PIN_6
|
||||
#define SCL_GPIO_Port GPIOB
|
||||
#define SDA_Pin GPIO_PIN_7
|
||||
#define SDA_GPIO_Port GPIOB
|
||||
#define SCL2_Pin GPIO_PIN_5
|
||||
#define SCL2_GPIO_Port GPIOA
|
||||
#define SDA2_Pin GPIO_PIN_1
|
||||
#define SDA2_GPIO_Port GPIOA
|
||||
#define INT_PD_Pin GPIO_PIN_9
|
||||
#define INT_PD_GPIO_Port GPIOA
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* BSP_MINIWARE_PINS_H_ */
|
||||
|
||||
@@ -8,10 +8,9 @@ bool FUSB302_present = false;
|
||||
void power_probe() {
|
||||
// If TS80 probe for QC
|
||||
// If TS100 - noop
|
||||
#ifdef MODEL_TS80
|
||||
#ifdef defined(MODEL_TS80)+defined(MODEL_TS80P)>0
|
||||
|
||||
startQC(systemSettings.voltageDiv);
|
||||
|
||||
seekQC((systemSettings.cutoutSetting) ? 120 : 90,
|
||||
systemSettings.voltageDiv); // this will move the QC output to the preferred voltage to start with
|
||||
|
||||
@@ -19,12 +18,12 @@ void power_probe() {
|
||||
}
|
||||
|
||||
void power_check() {
|
||||
#ifdef MODEL_TS80
|
||||
#ifdef defined(MODEL_TS80)+defined(MODEL_TS80P)>0
|
||||
QC_resync();
|
||||
#endif
|
||||
}
|
||||
uint8_t usb_pd_detect() {
|
||||
#ifdef MODEL_TS80
|
||||
#ifdef MODEL_TS80P
|
||||
FUSB302_present = fusb302_detect();
|
||||
if (FUSB302_present) {
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
@@ -39,9 +38,11 @@ uint8_t usb_pd_detect() {
|
||||
return false;
|
||||
}
|
||||
uint8_t pd_irq_read() {
|
||||
#ifdef MODEL_TS80
|
||||
return HAL_GPIO_ReadPin(INT_PD_GPIO_Port, INT_PD_Pin) == GPIO_PIN_SET ?
|
||||
1 : 0;
|
||||
#ifdef MODEL_TS80P
|
||||
if (FUSB302_present) {
|
||||
return HAL_GPIO_ReadPin(INT_PD_GPIO_Port, INT_PD_Pin) == GPIO_PIN_SET ?
|
||||
1 : 0;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ void QC_Post_Probe_En() {
|
||||
uint8_t QC_DM_PulledDown() { return HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_11) == GPIO_PIN_RESET ? 1 : 0; }
|
||||
|
||||
void QC_resync() {
|
||||
#ifdef MODEL_TS80
|
||||
#if defined(MODEL_TS80) + defined(MODEL_TS80P) >0
|
||||
seekQC((systemSettings.cutoutSetting) ? 120 : 90,
|
||||
systemSettings.voltageDiv); // Run the QC seek again if we have drifted too much
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifndef BSP_MINIWARE_UNITSETTINGS_H_
|
||||
#define BSP_MINIWARE_UNITSETTINGS_H_
|
||||
//On the TS80, the LIS accel is mounted backwards
|
||||
#ifdef MODEL_TS80
|
||||
#if defined(MODEL_TS80)+defined(MODEL_TS80P)>0
|
||||
#define LIS_ORI_FLIP
|
||||
#endif
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ void preRToSInit() {
|
||||
HAL_Delay(50);
|
||||
HAL_GPIO_WritePin(OLED_RESET_GPIO_Port, OLED_RESET_Pin, GPIO_PIN_SET);
|
||||
HAL_Delay(50);
|
||||
#ifdef MODEL_TS80
|
||||
#ifdef MODEL_TS80P
|
||||
I2CBB::init();
|
||||
//Spawn all of the USB-C processors
|
||||
fusb302_start_processing();
|
||||
|
||||
Reference in New Issue
Block a user