aboutsummaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/include.cmake2
-rw-r--r--shared/pb/moddrv.c (renamed from shared/pb/driver.c)19
-rw-r--r--shared/pb/moddrv.h (renamed from shared/pb/driver.h)0
3 files changed, 13 insertions, 8 deletions
diff --git a/shared/include.cmake b/shared/include.cmake
index f07a78b..c4b01c2 100644
--- a/shared/include.cmake
+++ b/shared/include.cmake
@@ -1,5 +1,5 @@
include_directories(${CMAKE_CURRENT_LIST_DIR})
add_library(puzbus STATIC
- ${CMAKE_CURRENT_LIST_DIR}/pb/driver.c
+ ${CMAKE_CURRENT_LIST_DIR}/pb/moddrv.c
)
diff --git a/shared/pb/driver.c b/shared/pb/moddrv.c
index f43d5c1..4c897e0 100644
--- a/shared/pb/driver.c
+++ b/shared/pb/moddrv.c
@@ -1,7 +1,7 @@
#include <memory.h>
#include "types.h"
-#include "driver.h"
+#include "moddrv.h"
/** \brief [private] placeholder global state variable */
static pb_state_t _global_state = PB_GS_NOINIT;
@@ -17,12 +17,6 @@ __weak void pbdrv_hook_mod_state_write(pb_state_t state) {
_global_state = state;
}
-__weak void pbdrv_hook_main_state_update(pb_state_t state) { }
-
-__weak bool pbdrv_hook_cmd(uint16_t i2c_addr, pb_cmd_t cmd, const char * buf, size_t sz) {
- return false;
-}
-
__weak void pbdrv_i2c_recv(uint16_t i2c_addr, const char * buf, size_t sz) {
if (sz == 0) return;
pb_cmd_t cmd = (enum pb_cmd) buf[0];
@@ -111,3 +105,14 @@ __weak void pbdrv_handle_sex(uint16_t i2c_addr, const char * buf, size_t sz) {
pbdrv_hook_main_state_update(_main_state);
}
+__weak void pbdrv_hook_main_state_update(pb_state_t state) { }
+__weak bool pbdrv_hook_cmd(uint16_t i2c_addr, pb_cmd_t cmd, const char * buf, size_t sz) {
+ return false;
+}
+__weak bool pbdrv_hook_read(uint16_t i2c_addr, uint8_t addr) {
+ return false;
+}
+__weak bool pbdrv_hook_write(uint16_t i2c_addr, uint8_t addr, const char * buf, size_t sz) {
+ return false;
+}
+
diff --git a/shared/pb/driver.h b/shared/pb/moddrv.h
index c4e1167..c4e1167 100644
--- a/shared/pb/driver.h
+++ b/shared/pb/moddrv.h