Skip to content

Commit 7c4e614

Browse files
committed
Alias common::Error as CError
1 parent 6468bc3 commit 7c4e614

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

src/main.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ use neotron_bmc_protocol::Receivable;
9292
use neotron_common_bios::{
9393
self as common,
9494
video::{Attr, TextBackgroundColour, TextForegroundColour},
95-
MemoryRegion, Option as COption, Result as CResult,
95+
Error as CError, MemoryRegion, Option as COption, Result as CResult,
9696
};
9797

9898
// -----------------------------------------------------------------------------
@@ -1437,7 +1437,7 @@ pub extern "C" fn serial_get_info(_device: u8) -> COption<common::serial::Device
14371437
/// Set the options for a given serial device. An error is returned if the
14381438
/// options are invalid for that serial device.
14391439
pub extern "C" fn serial_configure(_device: u8, _config: common::serial::Config) -> CResult<()> {
1440-
CResult::Err(common::Error::Unimplemented)
1440+
CResult::Err(CError::Unimplemented)
14411441
}
14421442

14431443
/// Write bytes to a serial port. There is no sense of 'opening' or
@@ -1450,7 +1450,7 @@ pub extern "C" fn serial_write(
14501450
_data: common::ApiByteSlice,
14511451
_timeout: COption<common::Timeout>,
14521452
) -> CResult<usize> {
1453-
CResult::Err(common::Error::Unimplemented)
1453+
CResult::Err(CError::Unimplemented)
14541454
}
14551455

14561456
/// Read bytes from a serial port. There is no sense of 'opening' or
@@ -1463,7 +1463,7 @@ pub extern "C" fn serial_read(
14631463
_data: common::ApiBuffer,
14641464
_timeout: COption<common::Timeout>,
14651465
) -> CResult<usize> {
1466-
CResult::Err(common::Error::Unimplemented)
1466+
CResult::Err(CError::Unimplemented)
14671467
}
14681468

14691469
/// Get the current wall time.
@@ -1555,14 +1555,14 @@ pub extern "C" fn time_clock_set(time: common::Time) {
15551555
/// length. How it stores them is up to the BIOS - it could be EEPROM, or
15561556
/// battery-backed SRAM.
15571557
pub extern "C" fn configuration_get(_buffer: common::ApiBuffer) -> CResult<usize> {
1558-
CResult::Err(common::Error::Unimplemented)
1558+
CResult::Err(CError::Unimplemented)
15591559
}
15601560

15611561
/// Set the configuration data block.
15621562
///
15631563
/// See `configuration_get`.
15641564
pub extern "C" fn configuration_set(_buffer: common::ApiByteSlice) -> CResult<()> {
1565-
CResult::Err(common::Error::Unimplemented)
1565+
CResult::Err(CError::Unimplemented)
15661566
}
15671567

15681568
/// Does this Neotron BIOS support this video mode?
@@ -1583,7 +1583,7 @@ pub extern "C" fn video_set_mode(mode: common::video::Mode) -> CResult<()> {
15831583
if vga::set_video_mode(mode) {
15841584
CResult::Ok(())
15851585
} else {
1586-
CResult::Err(common::Error::UnsupportedConfiguration(0))
1586+
CResult::Err(CError::UnsupportedConfiguration(0))
15871587
}
15881588
}
15891589

@@ -1625,7 +1625,7 @@ pub extern "C" fn video_get_framebuffer() -> *mut u8 {
16251625
/// The pointer must point to enough video memory to handle the current video
16261626
/// mode, and any future video mode you set.
16271627
pub unsafe extern "C" fn video_set_framebuffer(_buffer: *const u8) -> CResult<()> {
1628-
CResult::Err(common::Error::Unimplemented)
1628+
CResult::Err(CError::Unimplemented)
16291629
}
16301630

16311631
/// Find out whether the given video mode needs more VRAM than we currently have.
@@ -1768,7 +1768,7 @@ fn convert_hid_event(
17681768

17691769
/// Control the keyboard LEDs.
17701770
pub extern "C" fn hid_set_leds(_leds: common::hid::KeyboardLeds) -> CResult<()> {
1771-
CResult::Err(common::Error::Unimplemented)
1771+
CResult::Err(CError::Unimplemented)
17721772
}
17731773

17741774
/// Wait for the next occurence of the specified video scan-line.
@@ -1846,7 +1846,7 @@ extern "C" fn i2c_write_read(
18461846
_tx2: common::ApiByteSlice,
18471847
_rx: common::ApiBuffer,
18481848
) -> CResult<()> {
1849-
CResult::Err(common::Error::Unimplemented)
1849+
CResult::Err(CError::Unimplemented)
18501850
}
18511851

18521852
extern "C" fn audio_mixer_channel_get_info(
@@ -1856,35 +1856,35 @@ extern "C" fn audio_mixer_channel_get_info(
18561856
}
18571857

18581858
extern "C" fn audio_mixer_channel_set_level(_audio_mixer_id: u8, _level: u8) -> CResult<()> {
1859-
CResult::Err(common::Error::Unimplemented)
1859+
CResult::Err(CError::Unimplemented)
18601860
}
18611861

18621862
extern "C" fn audio_output_set_config(_config: common::audio::Config) -> CResult<()> {
1863-
CResult::Err(common::Error::Unimplemented)
1863+
CResult::Err(CError::Unimplemented)
18641864
}
18651865

18661866
extern "C" fn audio_output_get_config() -> CResult<common::audio::Config> {
1867-
CResult::Err(common::Error::Unimplemented)
1867+
CResult::Err(CError::Unimplemented)
18681868
}
18691869

18701870
unsafe extern "C" fn audio_output_data(_samples: common::ApiByteSlice) -> CResult<usize> {
1871-
CResult::Err(common::Error::Unimplemented)
1871+
CResult::Err(CError::Unimplemented)
18721872
}
18731873

18741874
extern "C" fn audio_output_get_space() -> CResult<usize> {
18751875
CResult::Ok(0)
18761876
}
18771877

18781878
extern "C" fn audio_input_set_config(_config: common::audio::Config) -> CResult<()> {
1879-
CResult::Err(common::Error::Unimplemented)
1879+
CResult::Err(CError::Unimplemented)
18801880
}
18811881

18821882
extern "C" fn audio_input_get_config() -> CResult<common::audio::Config> {
1883-
CResult::Err(common::Error::Unimplemented)
1883+
CResult::Err(CError::Unimplemented)
18841884
}
18851885

18861886
extern "C" fn audio_input_data(_samples: common::ApiBuffer) -> CResult<usize> {
1887-
CResult::Err(common::Error::Unimplemented)
1887+
CResult::Err(CError::Unimplemented)
18881888
}
18891889

18901890
extern "C" fn audio_input_get_count() -> CResult<usize> {
@@ -1904,11 +1904,11 @@ extern "C" fn bus_write_read(
19041904
_tx2: common::ApiByteSlice,
19051905
_rx: common::ApiBuffer,
19061906
) -> CResult<()> {
1907-
CResult::Err(common::Error::Unimplemented)
1907+
CResult::Err(CError::Unimplemented)
19081908
}
19091909

19101910
extern "C" fn bus_exchange(_buffer: common::ApiBuffer) -> CResult<()> {
1911-
CResult::Err(common::Error::Unimplemented)
1911+
CResult::Err(CError::Unimplemented)
19121912
}
19131913

19141914
extern "C" fn bus_interrupt_status() -> u32 {
@@ -1983,7 +1983,7 @@ pub extern "C" fn block_write(
19831983
_num_blocks: u8,
19841984
_data: common::ApiByteSlice,
19851985
) -> CResult<()> {
1986-
CResult::Err(common::Error::Unimplemented)
1986+
CResult::Err(CError::Unimplemented)
19871987
}
19881988

19891989
/// Read one or more sectors to a block device.
@@ -2003,7 +2003,7 @@ pub extern "C" fn block_read(
20032003
use embedded_sdmmc::BlockDevice;
20042004
check_stacks();
20052005
if data.data_len != usize::from(num_blocks) * 512 {
2006-
return CResult::Err(common::Error::UnsupportedConfiguration(0));
2006+
return CResult::Err(CError::UnsupportedConfiguration(0));
20072007
}
20082008
let mut lock = HARDWARE.lock();
20092009
let hw = lock.as_mut().unwrap();
@@ -2014,7 +2014,7 @@ pub extern "C" fn block_read(
20142014
hw.sdcard_poll();
20152015
let info = match &hw.card_state {
20162016
CardState::Online(info) => info.clone(),
2017-
_ => return CResult::Err(common::Error::NoMediaFound),
2017+
_ => return CResult::Err(CError::NoMediaFound),
20182018
};
20192019
// Run card at full speed
20202020
let spi = sdcard::FakeSpi(hw, false);
@@ -2036,13 +2036,13 @@ pub extern "C" fn block_read(
20362036
Ok(_) => CResult::Ok(()),
20372037
Err(e) => {
20382038
defmt::warn!("SD error reading {}: {:?}", block.0, e);
2039-
CResult::Err(common::Error::DeviceError(0))
2039+
CResult::Err(CError::DeviceError(0))
20402040
}
20412041
}
20422042
}
20432043
_ => {
20442044
// Nothing else supported by this BIOS
2045-
CResult::Err(common::Error::InvalidDevice)
2045+
CResult::Err(CError::InvalidDevice)
20462046
}
20472047
}
20482048
};
@@ -2066,7 +2066,7 @@ pub extern "C" fn block_verify(
20662066
_num_blocks: u8,
20672067
_data: common::ApiByteSlice,
20682068
) -> CResult<()> {
2069-
CResult::Err(common::Error::Unimplemented)
2069+
CResult::Err(CError::Unimplemented)
20702070
}
20712071

20722072
extern "C" fn block_dev_eject(_dev_id: u8) -> CResult<()> {

0 commit comments

Comments
 (0)