Fixed some priorities for IRQs for stability

Fixed ERROR/ERREUR messages position

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@403 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-12-15 13:03:39 +00:00
parent 85edb9131e
commit f3e4c109d1
4 changed files with 39 additions and 37 deletions

View File

@@ -46,7 +46,7 @@
#define BUZZER_MIN_PULSEWIDTH_MS (10)
#define BUZZER_KEYPAD_PULSEWIDTH_MS (60)
#define BUZZER_ERROR_PULSEWIDTH_MS (1000)
#define BUZZER_WARNING_PULSEWIDTH_MS (500)
#define BUZZER_WARNING_PULSEWIDTH_MS (250)
#define BUZZER_KEYPAD_ACKNOWLEDGE(self) \
Buzzer_singleTone(self, BUZZER_KEYPAD_PULSEWIDTH_MS)

View File

@@ -519,7 +519,7 @@ static ErrorStatus initPeriphery(void)
/* --------------------------------------------------------------------*/
/* ADC1 - for module feedback */
/* --------------------------------------------------------------------*/
IRQ_setInterruptProperties(ADC1_2_IRQn, 12, 12, ENABLE);
IRQ_setInterruptProperties(ADC1_2_IRQn, 11, 0, ENABLE);
adc1Parameters->ADC_Mode = ADC_Mode_Independent;
adc1Parameters->ADC_ScanConvMode = ENABLE;
adc1Parameters->ADC_ContinuousConvMode = ENABLE;
@@ -561,7 +561,7 @@ static ErrorStatus initPeriphery(void)
/* --------------------------------------------------------------------*/
/* USART1 */
/* --------------------------------------------------------------------*/
IRQ_setInterruptProperties(USART1_IRQn, 15, 15, ENABLE);
IRQ_setInterruptProperties(USART1_IRQn, 15, 0, ENABLE);
uart1->USART_TypeDef = USART1;
Uart_getDefaultParameters(uartLoggerParam);
// Adjust to higher baudrate for intensive logging
@@ -575,7 +575,7 @@ static ErrorStatus initPeriphery(void)
/* USART3 */
/* --------------------------------------------------------------------*/
// Initialize the Terminal UART
IRQ_setInterruptProperties(USART3_IRQn, 15, 15, ENABLE);
IRQ_setInterruptProperties(USART3_IRQn, 15, 1, ENABLE);
uart3->USART_TypeDef = USART3;
Uart_getDefaultParameters(uartTerminalParam);
// Adjust to higher baudrate for intensive logging
@@ -587,7 +587,7 @@ static ErrorStatus initPeriphery(void)
/* --------------------------------------------------------------------*/
/* SPI1 */
/* --------------------------------------------------------------------*/
IRQ_setInterruptProperties(SPI1_IRQn, 12, 12, ENABLE);
IRQ_setInterruptProperties(SPI1_IRQn, 11, 0, ENABLE);
spi1->initialized = false;
spi1->SPI_TypeDef = SPI1;
MAX5715_getSpiParameters(spiDACParam);
@@ -597,7 +597,7 @@ static ErrorStatus initPeriphery(void)
/* --------------------------------------------------------------------*/
/* SPI3 */
/* --------------------------------------------------------------------*/
IRQ_setInterruptProperties(SPI3_IRQn, 12, 12, ENABLE);
IRQ_setInterruptProperties(SPI3_IRQn, 12, 0, ENABLE);
spi3->initialized = false;
spi3->SPI_TypeDef = SPI3;
// Get the SPI parameters from the NHD0420 driver. They are more critical than the parameters from the EEPROM
@@ -629,8 +629,8 @@ static ErrorStatus initPeriphery(void)
GPIO_EXTILineConfig(GPIO_PortSourceGPIOD, GPIO_PinSource7);
keypad->column[3].EXTI_InitStruct = configureEXTI(EXTI_Line7, EXTI_Mode_Interrupt, EXTI_Trigger_Rising_Falling, ENABLE);
IRQ_setInterruptProperties(EXTI4_IRQn, 12, 12, ENABLE);
IRQ_setInterruptProperties(EXTI9_5_IRQn, 12, 12, ENABLE);
IRQ_setInterruptProperties(EXTI4_IRQn, 11, 1, ENABLE);
IRQ_setInterruptProperties(EXTI9_5_IRQn, 11, 1, ENABLE);
/* --------------------------------------------------------------------*/

View File

@@ -118,29 +118,29 @@ ErrorStatus hsb_enableSafetyWithError(void)
CoverSolenoid_lock();
}
if (returnValue == SUCCESS)
{
// Check for INTERLOCK CLOSE
if (Interlock_isClosed(interlock))
{
// Enable Interrupt for interlock switch
Interlock_setEXTI(interlock, ENABLE);
}
else
{
Error_postError(INTERLOCK_COMMON_FAIL);
returnValue = ERROR;
}
}
if (returnValue == SUCCESS)
{
// In case of a TESLA repair, release the teslaGunSafety
if (PCBA_getInstance()->pcba == PCBA_Tesla)
{
TeslaGunSafety_release();
}
}
// if (returnValue == SUCCESS)
// {
// // Check for INTERLOCK CLOSE
// if (Interlock_isClosed(interlock))
// {
// // Enable Interrupt for interlock switch
// Interlock_setEXTI(interlock, ENABLE);
// }
// else
// {
// Error_postError(INTERLOCK_COMMON_FAIL);
// returnValue = ERROR;
// }
// }
//
// if (returnValue == SUCCESS)
// {
// // In case of a TESLA repair, release the teslaGunSafety
// if (PCBA_getInstance()->pcba == PCBA_Tesla)
// {
// TeslaGunSafety_release();
// }
// }
if (returnValue == SUCCESS)
{
@@ -221,10 +221,10 @@ ErrorStatus hsb_disableSafety(void)
snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "POWER DOWN");
Display_write(mainDisplay, buffer, 4, 6);
while (HighVoltageDetection_isVoltagePresent())
{
vTaskDelay(100);
}
// while (HighVoltageDetection_isVoltagePresent())
// {
// vTaskDelay(100);
// }
Display_clearLine(mainDisplay, 3);

View File

@@ -334,7 +334,7 @@ static void repairMenu_printRepair(struct MenuCore* self)
if (repairProcess_isProcessRunning(repairProcess))
{
int loopCounter = 0;
char buffer[20];
char buffer[self->display->displayDevice->parameters.numberOfColumns + 1];
if (xSemaphoreTake(repairMenu->repairScreenUpdateSemaphore, 0) != pdTRUE)
{
// Taking semaphore failed - no update on the screen
@@ -373,7 +373,8 @@ static void repairMenu_printRepair(struct MenuCore* self)
}
else
{
snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%s ", MenuText_REPAIR_SCREEN[languageIndex][3]);
snprintf(buffer, sizeof(buffer) / sizeof(buffer[0]), "%*.*s", self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS, self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS, MenuText_REPAIR_SCREEN[languageIndex][3]);
Display_write(self->display, buffer, 4, (loopCounter + (loopCounter * (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS)) + (self->display->displayDevice->parameters.numberOfColumns / REPAIRPROCESS_NUMBER_OF_ROWS) / strlen(buffer)));
}
}
@@ -1045,6 +1046,7 @@ static void repairMenu_abortRepairProcessAndGotoMainMenu(struct MenuCore* self)
{
repairMenu_stopRepairProcess(self);
MenuCore_changeState(self, RM_MAINMENU);
PowerLossDetector_clearBusyFlag();
}