Skip to content

Commit 402e0c8

Browse files
Merge pull request #42 from Neotron-Compute/remove-unimplemented
Make the API return useful error codes.
2 parents 8c3d298 + 3924116 commit 402e0c8

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

src/main.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ unsafe extern "C" fn video_set_whole_palette(
14521452
}
14531453

14541454
extern "C" fn i2c_bus_get_info(_i2c_bus: u8) -> common::Option<common::i2c::BusInfo> {
1455-
unimplemented!();
1455+
common::Option::None
14561456
}
14571457

14581458
extern "C" fn i2c_write_read(
@@ -1462,69 +1462,69 @@ extern "C" fn i2c_write_read(
14621462
_tx2: common::ApiByteSlice,
14631463
_rx: common::ApiBuffer,
14641464
) -> common::Result<()> {
1465-
unimplemented!();
1465+
common::Result::Err(common::Error::Unimplemented)
14661466
}
14671467

14681468
extern "C" fn audio_mixer_channel_get_info(
14691469
_audio_mixer_id: u8,
14701470
) -> common::Option<common::audio::MixerChannelInfo> {
1471-
unimplemented!();
1471+
common::Option::None
14721472
}
14731473

14741474
extern "C" fn audio_mixer_channel_set_level(_audio_mixer_id: u8, _level: u8) -> common::Result<()> {
1475-
unimplemented!();
1475+
common::Result::Err(common::Error::Unimplemented)
14761476
}
14771477

14781478
extern "C" fn audio_output_set_config(_config: common::audio::Config) -> common::Result<()> {
1479-
unimplemented!();
1479+
common::Result::Err(common::Error::Unimplemented)
14801480
}
14811481

14821482
extern "C" fn audio_output_get_config() -> common::Result<common::audio::Config> {
1483-
unimplemented!();
1483+
common::Result::Err(common::Error::Unimplemented)
14841484
}
14851485

14861486
unsafe extern "C" fn audio_output_data(_samples: common::ApiByteSlice) -> common::Result<usize> {
1487-
unimplemented!();
1487+
common::Result::Err(common::Error::Unimplemented)
14881488
}
14891489

14901490
extern "C" fn audio_output_get_space() -> common::Result<usize> {
1491-
unimplemented!();
1491+
common::Result::Ok(0)
14921492
}
14931493

14941494
extern "C" fn audio_input_set_config(_config: common::audio::Config) -> common::Result<()> {
1495-
unimplemented!();
1495+
common::Result::Err(common::Error::Unimplemented)
14961496
}
14971497

14981498
extern "C" fn audio_input_get_config() -> common::Result<common::audio::Config> {
1499-
unimplemented!();
1499+
common::Result::Err(common::Error::Unimplemented)
15001500
}
15011501

15021502
extern "C" fn audio_input_data(_samples: common::ApiBuffer) -> common::Result<usize> {
1503-
unimplemented!();
1503+
common::Result::Err(common::Error::Unimplemented)
15041504
}
15051505

15061506
extern "C" fn audio_input_get_count() -> common::Result<usize> {
1507-
unimplemented!();
1507+
common::Result::Ok(0)
15081508
}
15091509

15101510
extern "C" fn bus_select(_periperal_id: common::Option<u8>) {
1511-
unimplemented!();
1511+
// Do nothing
15121512
}
15131513

15141514
extern "C" fn bus_get_info(_periperal_id: u8) -> common::Option<common::bus::PeripheralInfo> {
1515-
unimplemented!();
1515+
common::Option::None
15161516
}
15171517

15181518
extern "C" fn bus_write_read(
15191519
_tx: common::ApiByteSlice,
15201520
_tx2: common::ApiByteSlice,
15211521
_rx: common::ApiBuffer,
15221522
) -> common::Result<()> {
1523-
unimplemented!();
1523+
common::Result::Err(common::Error::Unimplemented)
15241524
}
15251525

15261526
extern "C" fn bus_exchange(_buffer: common::ApiBuffer) -> common::Result<()> {
1527-
unimplemented!();
1527+
common::Result::Err(common::Error::Unimplemented)
15281528
}
15291529

15301530
extern "C" fn bus_interrupt_status() -> u32 {

0 commit comments

Comments
 (0)