Rev 21 | Rev 23 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 21 | Rev 22 | ||
---|---|---|---|
Line 206... | Line 206... | ||
206 | { |
206 | { |
207 | uint16_t curr_val = dial_pos[dial]; |
207 | uint16_t curr_val = dial_pos[dial]; |
208 | rc = EE_ReadVariable(VirtAddVarTab[dial],&curr_val); |
208 | rc = EE_ReadVariable(VirtAddVarTab[dial],&curr_val); |
209 | if((rc !=0) || (curr_val != dial_pos[dial])) |
209 | if((rc !=0) || (curr_val != dial_pos[dial])) |
210 | { |
210 | { |
- | 211 | //__disable_irq(); |
|
211 | HAL_FLASH_Unlock(); |
212 | HAL_FLASH_Unlock(); |
212 | 213 | ||
213 | rc = EE_WriteVariable(VirtAddVarTab[dial],dial_pos[dial]); |
214 | rc = EE_WriteVariable(VirtAddVarTab[dial],dial_pos[dial]); |
214 | HAL_FLASH_Lock(); |
215 | HAL_FLASH_Lock(); |
- | 216 | //__enable_irq(); |
|
215 | } |
217 | } |
216 | } |
218 | } |
217 | } |
219 | } |
218 | 220 | ||
219 | } |
221 | } |
Line 338... | Line 340... | ||
338 | EnableSerialRxInterrupt(&uc1); |
340 | EnableSerialRxInterrupt(&uc1); |
339 | EnableSerialRxInterrupt(&uc2); |
341 | EnableSerialRxInterrupt(&uc2); |
340 | /* Unlock the Flash to enable the flash control register access *************/ |
342 | /* Unlock the Flash to enable the flash control register access *************/ |
341 | HAL_FLASH_Unlock(); |
343 | HAL_FLASH_Unlock(); |
342 | 344 | ||
- | 345 | //__disable_irq(); |
|
343 | EE_Init(); |
346 | EE_Init(); |
- | 347 | //__enable_irq(); |
|
344 | 348 | ||
345 | HAL_FLASH_Lock(); |
349 | HAL_FLASH_Lock(); |
346 | 350 | ||
- | 351 | ||
- | 352 | InitSwitches(); |
|
- | 353 | ||
347 | int i; |
354 | int i; |
348 | uint16_t rc; |
355 | uint16_t rc; |
349 | for(i=0;i<2;i++) |
356 | for(i=0;i<2;i++) |
350 | { |
357 | { |
351 | uint16_t val; |
358 | uint16_t val; |
Line 394... | Line 401... | ||
394 | display(); |
401 | display(); |
395 | 402 | ||
396 | } |
403 | } |
397 | 404 | ||
398 | 405 | ||
399 | InitSwitches(); |
- | |
400 | 406 | ||
401 | /* USER CODE END 2 */ |
407 | /* USER CODE END 2 */ |
402 | 408 | ||
403 | /* Infinite loop */ |
409 | /* Infinite loop */ |
404 | /* USER CODE BEGIN WHILE */ |
410 | /* USER CODE BEGIN WHILE */ |
Line 419... | Line 425... | ||
419 | { |
425 | { |
420 | // poll switches |
426 | // poll switches |
421 | HandleSwitches(); |
427 | HandleSwitches(); |
422 | 428 | ||
423 | 429 | ||
424 | - | ||
425 | - | ||
426 | uint16_t cc = SerialCharsReceived(&uc1); |
430 | uint16_t cc = SerialCharsReceived(&uc1); |
427 | int chr; |
431 | int chr; |
428 | for (chr = 0; chr < cc; chr++) |
432 | for (chr = 0; chr < cc; chr++) |
429 | { |
433 | { |
430 | char c = GetCharSerial(&uc1); |
434 | char c = GetCharSerial(&uc1); |