Skip to content

Commit 06d9ffb

Browse files
committed
revert: get capacitor range
1 parent 116dadd commit 06d9ffb

File tree

3 files changed

+1
-42
lines changed

3 files changed

+1
-42
lines changed

src/commands.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ command_func_t* const cmd_table[NUM_PRIMARY_CMDS + 1][NUM_SECONDARY_CMDS_MAX + 1
252252
// 12 READ_PROGRAM_ADDRESS 13 WRITE_PROGRAM_ADDRESS 14 READ_DATA_ADDRESS 15 WRITE_DATA_ADDRESS
253253
Removed, Removed, DEVICE_ReadRegisterData, DEVICE_WriteRegisterData,
254254
// 16 GET_CAP_RANGE 17 SET_RGB2 18 READ_LOG 19 RESTORE_STANDALONE
255-
MULTIMETER_GetCapRange, Removed, Removed, DEVICE_Reset,
255+
Unimplemented, Removed, Removed, DEVICE_Reset,
256256
// 20 GET_ALTERNATE_HIGH_FREQUENCY 21 SET_RGB_COMMON 22 SET_RGB3 23 START_CTMU
257257
Unimplemented, LIGHT_RGBPin, Removed, CTMU_Start,
258258
// 24 STOP_CTMU 25 START_COUNTING 26 FETCH_COUNT 27 FILL_BUFFER

src/instruments/multimeter.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ void ChargeCapacitor(uint8_t charge, uint16_t period);
1616
void GetCapacitance_InitCTMU_TMR5(uint8_t current_range, uint8_t trim,
1717
uint16_t charge_time);
1818
void GetCapacitance_ConfigADC_CTMU_TMR5();
19-
void GetCapacitor_Range(uint16_t charge_time);
2019

2120
void ChargeCapacitor(uint8_t charge, uint16_t period) {
2221
CAP_OUT_SetDigitalOutput();
@@ -96,33 +95,6 @@ uint16_t GetVoltage_Summed(uint8_t channel) {
9695
return voltage_sum;
9796
}
9897

99-
uint16_t GetCapacitor_Range(uint16_t charge_time) {
100-
101-
ChargeCapacitor(0, 50000);
102-
ChargeCapacitor(0, 50000); // TODO: Check if we need two of these
103-
104-
ADC1_SetOperationMode(ADC1_12BIT_AVERAGING_MODE, CH0_CHANNEL_CAP, 0);
105-
106-
TMR5_Initialize();
107-
TMR5_Period16BitSet(charge_time);
108-
TMR5_SetPrescaler(TMR_PRESCALER_64);
109-
TMR5_Start();
110-
111-
// Start charging the capacitor through 10K resistor
112-
CAP_OUT_SetDigitalOutput();
113-
CAP_OUT_SetHigh();
114-
115-
TMR5_WaitForInterruptEvent();
116-
117-
// Stop the charging process
118-
CAP_OUT_SetDigitalInput();
119-
CAP_OUT_SetLow();
120-
121-
uint16_t total = GetVoltage_Summed(CH0_CHANNEL_CAP);
122-
123-
return total;
124-
}
125-
12698
response_t MULTIMETER_GetVoltage(void) {
12799

128100
uint8_t channel = UART1_Read();

src/instruments/multimeter.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,6 @@ extern "C" {
2828
* @return SUCCESS
2929
*/
3030
response_t MULTIMETER_GetCapacitance(void);
31-
32-
/**
33-
* @brief Get an estimate of the capacitor range
34-
*
35-
* @description
36-
* This command takes only one argument over serial:
37-
* 1. (uint16) Charge time
38-
*
39-
* It returns the range value as uint16.
40-
*
41-
* @return SUCCESS
42-
*/
43-
response_t MULTIMETER_GetCapRange(void);
4431

4532
/**
4633
* @brief Measurements using Charge Time Measurement Unit

0 commit comments

Comments
 (0)