Skip to content

Conversation

@serdzz
Copy link

@serdzz serdzz commented Nov 26, 2025

No description provided.

Sergejs Lepins added 9 commits November 3, 2022 10:48
- adc: Use derive(Default) for VTemp/VRef, remove useless conversion
- dma: Replace manual non-exhaustive pattern with #[non_exhaustive]
- exti: Use range patterns (0..=3) instead of OR patterns
- gpio: Remove unused borrows and add cfg guards for unused imports
- i2c: Use manual_range_contains pattern
- qei: Remove legacy numeric constant import
- rcc: Use derive(Default) for MSIRange enum
- serial: Use #[non_exhaustive] and iter() instead of into_iter()
- spi: Use #[non_exhaustive] attribute
- time: Use From instead of Into, remove unnecessary drop()
- Add RTC backup register methods (read/write_backup_register)
- Add RTC initialization check methods (is_initialized/mark_initialized)
- Fix critical bug: use modify() instead of write() for RCC registers
  - Prevents unintended disabling of other clock sources
  - Affects: CR, ICSCR, CFGR, APB1ENR registers
- Fix register access in multiple peripheral drivers:
  - rtc.rs: APB1ENR register
  - rcc.rs: CR, ICSCR, CFGR registers
  - adc.rs: CR register
  - timer.rs: DIER, SR registers
  - serial.rs: CR1, CR2 registers
  - pwm.rs: CR1 register
  - spi.rs: CR1, CR2 registers
  - watchdog.rs: CR, CFR registers

Using write() overwrites entire registers, potentially disabling other
peripherals. Now using modify() to preserve existing configuration.
- Add rtc_backup_simple.rs: demonstrates backup register usage
  - Power-loss detection with magic number
  - Boot counter that persists across resets
  - Multiple backup register usage

- Add rtc_backup.rs: complete RTC example with timekeeping
  - RTC initialization check
  - Date/time setting and reading
  - RTC wakeup timer
  - Backup register boot counter

- Add examples/README.md
  - Comprehensive documentation for all examples
  - RTC backup register feature documentation
  - Building and running instructions
  - Hardware requirements and troubleshooting
- Remove unused gpioe and gpioh imports in gpio macro
- Change MCO configuration to use .bits() instead of .variant() for stm32l100 compatibility
- All variants (stm32l100, stm32l151, stm32l152, stm32l162) now compile without warnings
- rtc_backup.rs: prefix unused rcc variable with underscore and remove mut
- button_irq.rs: replace deprecated NVIC.enable() with NVIC::unmask()
- Break long method chains into multiple lines for better readability
- button_irq.rs: remove unused prelude import and cp variable
- timer.rs: replace NVIC.enable() with NVIC::unmask()
- rtic.rs: replace clear_irq() with clear_interrupt_pending_bit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant