Files
ESPDocs/public/exemplos/fr/rust-esp.rs
T
Lucas RayanandAntigravity 7fce46b9e1
CI / Lint e auditorias (push) Successful in 49s
CI / Trivy (dependências e segredos) (push) Successful in 11s
CI / Imagem Docker (linux/arm64) (push) Successful in 3m14s
feat(i18n): French and German localization (phase 5)
- Add full message catalogs and content for French (fr) and German (de)
- Implement ASCII canonical slugs for French and German routes
- Add language-specific search endpoints (/api/busca/fr, /api/busca/de)
- Configure strict 404 responses for /fr/livro and /de/livro
- Localize SEO, OpenGraph (fr_FR, de_DE), Twitter and JSON-LD schemas
- Add localized code example comments across 14 examples for fr and de
- Enable 'fr' and 'de' in ENABLED_LOCALES with root negotiation and redirect
- Extend test suite in check-i18n, smoke-imagem and verifica-vazamentos

Co-Authored-By: Antigravity <noreply@google.com>
2026-11-01 22:06:36 -03:00

49 lines
1.4 KiB
Rust

//! Exemplo Rust no ESP32 usando `esp-hal` (Modo Bare-Metal / no_std)
//! Pisca um LED e envia mensagens via UART Serial com segurança de memória garantida.
//!
//! Cargo.toml:
//! esp-hal = { version = "0.22", features = ["esp32s3"] }
//! esp-println = { version = "0.12", features = ["esp32s3", "log"] }
#![no_std]
#![no_main]
use esp_backtrace as _;
use esp_hal::{
clock::ClockControl,
gpio::{Io, Level, Output},
peripherals::Peripherals,
system::SystemControl,
timer::timg::TimerGroup,
delay::Delay,
prelude::*,
};
use esp_println::println;
#[entry]
fn main() -> ! {
// Inicializa periféricos do SoC com verificação em tempo de compilação
let peripherals = Peripherals::take();
let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
// Configura os pinos de E/S
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
let mut led = Output::new(io.pins.gpio2, Level::Low);
let delay = Delay::new(&clocks);
println!("🦀 Firmware Rust Bare-Metal inicializado no ESP32!");
let mut counter: u32 = 0;
loop {
// Inverte estado do LED com garantia de exclusão mútua
led.toggle();
counter += 1;
println!("Ciclo Rust #{}: LED está {:?}", counter, led.is_set_high());
delay.delay_millis(500);
}
}