Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleGuest committed May 13, 2024
1 parent 6fef225 commit d7ddc7a
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 11 deletions.
2 changes: 2 additions & 0 deletions cube/src/bagua.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!("../../rfcs/001_bagua.md")]

use embassy_time::Timer;

use crate::{App, CubeRng, RNG};
Expand Down
8 changes: 8 additions & 0 deletions cube/src/cube_man.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!("../../rfcs/006_cube_man.md")]

use alloc::{collections::VecDeque, vec::Vec};
use cube_rand::CubeRng;
use embassy_time::Timer;
Expand Down Expand Up @@ -26,6 +28,12 @@ pub struct CubeManGame {
waiting_time: u64,
}

impl Default for CubeManGame {
fn default() -> Self {
Self::new()
}
}

impl CubeManGame {
pub fn new() -> Self {
let floors = FloorGen::init();
Expand Down
2 changes: 2 additions & 0 deletions cube/src/dice.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!("../../rfcs/002_dice.md")]

use embassy_time::Timer;

use crate::{App, CubeRng, RNG};
Expand Down
22 changes: 11 additions & 11 deletions cube/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ use crate::sokoban::Sokoban;
#[macro_use]
extern crate alloc;

mod bagua;
mod battery;
pub mod bagua;
pub mod battery;
pub mod buzzer;
mod cube_man;
mod dice;
mod face;
pub mod cube_man;
pub mod dice;
pub mod face;
pub mod ledc;
mod mapping;
mod maze;
mod snake;
mod sokoban;
mod timers;
mod ui;
pub mod mapping;
pub mod maze;
pub mod snake;
pub mod sokoban;
pub mod timers;
pub mod ui;

pub static mut RNG: MaybeUninit<Rng> = MaybeUninit::uninit();

Expand Down
2 changes: 2 additions & 0 deletions cube/src/maze.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!("../../rfcs/005_maze.md")]

use alloc::vec::Vec;
use embassy_time::Timer;
use embedded_graphics_core::{
Expand Down
8 changes: 8 additions & 0 deletions cube/src/snake.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!("../../rfcs/003_snake.md")]

use alloc::collections::LinkedList;
use embassy_time::Timer;

Expand All @@ -20,6 +22,12 @@ pub struct SnakeGame {
game_over: bool,
}

impl Default for SnakeGame {
fn default() -> Self {
Self::new()
}
}

impl SnakeGame {
pub fn new() -> Self {
let width = 8;
Expand Down
6 changes: 6 additions & 0 deletions cube/src/sokoban.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ pub struct Sokoban {
game_over: bool,
}

impl Default for Sokoban {
fn default() -> Self {
Self::new()
}
}

impl Sokoban {
pub fn new() -> Self {
let xsb = "
Expand Down
2 changes: 2 additions & 0 deletions cube/src/timers.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!("../../rfcs/004_timer.md")]

use alloc::vec::Vec;
use embassy_time::Timer;
use embedded_graphics_core::{
Expand Down

0 comments on commit d7ddc7a

Please sign in to comment.