Skip to content

Commit

Permalink
removed vApplicationStackOverflowHook
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jul 12, 2019
1 parent 0ce9de5 commit b2034f7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
20 changes: 18 additions & 2 deletions src/eez/modules/psu/stm32/adc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,35 @@ bool AnalogDigitalConverter::test() {
void AnalogDigitalConverter::tick(uint32_t tick_usec) {
if (start_reg0) {
// int ready = !HAL_GPIO_ReadPin(SPI2_IRQ_GPIO_Port, SPI2_IRQ_Pin)

int ready;

if (g_slots[channel.slotIndex].moduleType == MODULE_TYPE_DCP405) {
uint8_t gpioa = channel.ioexp.readGpio();
ready = !(gpioa & 0b00010000);
} else {
uint8_t gpiob = channel.ioexp.readGpioB();
ready = !(gpiob & 0b10000000);
}

// int ready = tick_usec - start_time > 10000;

if (ready) {
int16_t adc_data = read();

static int counter = 0;
if (start_reg0 == ADC_REG0_READ_I_MON && adc_data > 3276) {
++counter;
taskENTER_CRITICAL();
delay(500);
taskEXIT_CRITICAL();
}

channel.eventAdcData(adc_data);

#ifdef DEBUG
#ifdef DEBUG
debug::g_adcCounter.inc();
#endif
#endif
}
}
}
Expand All @@ -165,6 +179,8 @@ void AnalogDigitalConverter::start(uint8_t reg0) {
spi::select(channel.slotIndex, spi::CHIP_ADC);
spi::transfer(channel.slotIndex, data, result, 3);
spi::deselect(channel.slotIndex);

// start_time = micros();
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/eez/platform/stm32/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@

extern "C" void SystemClock_Config(void);

extern "C" void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName ) {
while (true) {}
}

int main(int argc, char **argv) {
HAL_Init();

Expand Down
2 changes: 1 addition & 1 deletion src/third_party/stm32/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-936842781161742032" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-1346926534290759488" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down

0 comments on commit b2034f7

Please sign in to comment.