Skip to content

Commit

Permalink
extmod: rename modhubcommon to pbhub
Browse files Browse the repository at this point in the history
This file does not contain an actual python module, only helper functions, so rename it accordingly.

Also remove nonexistant functions from the header file and add include guard.
  • Loading branch information
dlech committed Jun 1, 2019
1 parent c45103c commit 28e4fd2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bricks/stm32.mk
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ PYBRICKS_PY_SRC_C = $(addprefix ports/pybricks/extmod/,\
modcommon.c \
moddebug.c \
modhub4.c \
modhubcommon.c \
modmotor.c \
modmovehub.c \
modparameters.c \
modpupdevices.c \
modtools.c \
pberror.c \
pbhub.c \
pbiodevice.c \
)

Expand Down
2 changes: 1 addition & 1 deletion extmod/modhub4.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include "py/runtime.h"

#include "modmotor.h"
#include "modhubcommon.h"
#include "modcommon.h"
#include "pberror.h"
#include "pbhub.h"
#include "pbobj.h"

/* Move Hub module table */
Expand Down
2 changes: 1 addition & 1 deletion extmod/modmovehub.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include "py/runtime.h"

#include "modmotor.h"
#include "modhubcommon.h"
#include "modcommon.h"
#include "pberror.h"
#include "pbhub.h"
#include "pbobj.h"

/* Move Hub module table */
Expand Down
10 changes: 1 addition & 9 deletions extmod/modhubcommon.c → extmod/pbhub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@

#include "py/mpconfig.h"

#include <stdio.h>

#include <pbdrv/battery.h>
#include <pbio/light.h>
#include <pbsys/sys.h>

#include "py/obj.h"

#include "modmotor.h"
#include "modhubcommon.h"
#include "pberror.h"
#include "pbobj.h"

#include "pbhub.h"

STATIC mp_obj_t hub_shutdown(void) {
pbsys_power_off();
Expand Down
9 changes: 6 additions & 3 deletions extmod/modhubcommon.h → extmod/pbhub.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2018 Laurens Valk

#ifndef _PB_EXTMOD_PBHUB_H_
#define _PB_EXTMOD_PBHUB_H_

#include "py/obj.h"

/* Enums */

/* Module functions */
const mp_obj_fun_builtin_fixed_t hub_batt_volt_obj;
const mp_obj_fun_builtin_fixed_t hub_batt_cur_obj;
/* Functions */
const mp_obj_fun_builtin_fixed_t hub_shutdown_obj;
const mp_obj_fun_builtin_fixed_t hub_reboot_obj;
const mp_obj_fun_builtin_fixed_t hub_update_obj;

#endif // _PB_EXTMOD_PBHUB_H_

0 comments on commit 28e4fd2

Please sign in to comment.