summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-01-04 16:10:42 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-01-04 16:10:42 +0300
commiteac22e29a5844e5aa5c865c2e73900e6ef039ad6 (patch)
treeeb6061370af9e70c7d7f155ce39869251a8c1930 /stmhal
parentc3f70c603efcb053810dbee8d5cc9f23ed62d01f (diff)
downloadmicropython-eac22e29a5844e5aa5c865c2e73900e6ef039ad6.tar.gz
micropython-eac22e29a5844e5aa5c865c2e73900e6ef039ad6.zip
all: Consistently update signatures of .make_new and .call methods.
Otherwise, they serve reoccurring source of copy-paste mistakes and breaking nanbox build.
Diffstat (limited to 'stmhal')
-rw-r--r--stmhal/accel.c2
-rw-r--r--stmhal/adc.c4
-rw-r--r--stmhal/can.c2
-rw-r--r--stmhal/dac.c2
-rw-r--r--stmhal/extint.c2
-rw-r--r--stmhal/i2c.c2
-rw-r--r--stmhal/lcd.c2
-rw-r--r--stmhal/led.c2
-rw-r--r--stmhal/modnwcc3k.c2
-rw-r--r--stmhal/modnwwiznet5k.c2
-rw-r--r--stmhal/modusocket.c2
-rw-r--r--stmhal/pin.c4
-rw-r--r--stmhal/rtc.c2
-rw-r--r--stmhal/servo.c2
-rw-r--r--stmhal/spi.c2
-rw-r--r--stmhal/timer.c2
-rw-r--r--stmhal/uart.c2
-rw-r--r--stmhal/usb.c4
-rw-r--r--stmhal/usrsw.c4
19 files changed, 23 insertions, 23 deletions
diff --git a/stmhal/accel.c b/stmhal/accel.c
index ec517fe436..827e9177a0 100644
--- a/stmhal/accel.c
+++ b/stmhal/accel.c
@@ -125,7 +125,7 @@ STATIC pyb_accel_obj_t pyb_accel_obj;
/// accel = pyb.Accel()
/// pyb.delay(20)
/// print(accel.x())
-STATIC mp_obj_t pyb_accel_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_accel_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 0, 0, false);
diff --git a/stmhal/adc.c b/stmhal/adc.c
index be735e087f..11259546b9 100644
--- a/stmhal/adc.c
+++ b/stmhal/adc.c
@@ -275,7 +275,7 @@ STATIC void adc_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t
/// \classmethod \constructor(pin)
/// Create an ADC object associated with the given pin.
/// This allows you to then read analog values on that pin.
-STATIC mp_obj_t adc_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t adc_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check number of arguments
mp_arg_check_num(n_args, n_kw, 1, 1, false);
@@ -598,7 +598,7 @@ float adc_read_core_vref(ADC_HandleTypeDef *adcHandle) {
/******************************************************************************/
/* Micro Python bindings : adc_all object */
-STATIC mp_obj_t adc_all_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t adc_all_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check number of arguments
mp_arg_check_num(n_args, n_kw, 1, 2, false);
diff --git a/stmhal/can.c b/stmhal/can.c
index 3157bfadcf..e293b87425 100644
--- a/stmhal/can.c
+++ b/stmhal/can.c
@@ -339,7 +339,7 @@ STATIC mp_obj_t pyb_can_init_helper(pyb_can_obj_t *self, mp_uint_t n_args, const
///
/// - `CAN(1)` is on `YA`: `(RX, TX) = (Y3, Y4) = (PB8, PB9)`
/// - `CAN(2)` is on `YB`: `(RX, TX) = (Y5, Y6) = (PB12, PB13)`
-STATIC mp_obj_t pyb_can_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_can_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
diff --git a/stmhal/dac.c b/stmhal/dac.c
index a9b1b9eca7..48c0ce8bdd 100644
--- a/stmhal/dac.c
+++ b/stmhal/dac.c
@@ -206,7 +206,7 @@ STATIC mp_obj_t pyb_dac_init_helper(pyb_dac_obj_t *self, mp_uint_t n_args, const
///
/// `port` can be a pin object, or an integer (1 or 2).
/// DAC(1) is on pin X5 and DAC(2) is on pin X6.
-STATIC mp_obj_t pyb_dac_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_dac_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
diff --git a/stmhal/extint.c b/stmhal/extint.c
index 02b06fde5e..dacf8dd568 100644
--- a/stmhal/extint.c
+++ b/stmhal/extint.c
@@ -350,7 +350,7 @@ STATIC const mp_arg_t pyb_extint_make_new_args[] = {
};
#define PYB_EXTINT_MAKE_NEW_NUM_ARGS MP_ARRAY_SIZE(pyb_extint_make_new_args)
-STATIC mp_obj_t extint_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t extint_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// type_in == extint_obj_type
// parse args
diff --git a/stmhal/i2c.c b/stmhal/i2c.c
index 8e1970962b..29c350d22f 100644
--- a/stmhal/i2c.c
+++ b/stmhal/i2c.c
@@ -576,7 +576,7 @@ STATIC mp_obj_t pyb_i2c_init_helper(const pyb_i2c_obj_t *self, mp_uint_t n_args,
///
/// - `I2C(1)` is on the X position: `(SCL, SDA) = (X9, X10) = (PB6, PB7)`
/// - `I2C(2)` is on the Y position: `(SCL, SDA) = (Y9, Y10) = (PB10, PB11)`
-STATIC mp_obj_t pyb_i2c_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_i2c_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
diff --git a/stmhal/lcd.c b/stmhal/lcd.c
index c406d64477..e73b6e16d3 100644
--- a/stmhal/lcd.c
+++ b/stmhal/lcd.c
@@ -194,7 +194,7 @@ STATIC void lcd_write_strn(pyb_lcd_obj_t *lcd, const char *str, unsigned int len
///
/// Construct an LCD object in the given skin position. `skin_position` can be 'X' or 'Y', and
/// should match the position where the LCD pyskin is plugged in.
-STATIC mp_obj_t pyb_lcd_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_lcd_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, 1, false);
diff --git a/stmhal/led.c b/stmhal/led.c
index 399d4e729b..357aed4074 100644
--- a/stmhal/led.c
+++ b/stmhal/led.c
@@ -290,7 +290,7 @@ void led_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t ki
/// Create an LED object associated with the given LED:
///
/// - `id` is the LED number, 1-4.
-STATIC mp_obj_t led_obj_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t led_obj_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, 1, false);
diff --git a/stmhal/modnwcc3k.c b/stmhal/modnwcc3k.c
index dcef1f99b5..19aeabf5ce 100644
--- a/stmhal/modnwcc3k.c
+++ b/stmhal/modnwcc3k.c
@@ -427,7 +427,7 @@ STATIC const cc3k_obj_t cc3k_obj = {{(mp_obj_type_t*)&mod_network_nic_type_cc3k}
// [SPI on Y position; Y6=B13=SCK, Y7=B14=MISO, Y8=B15=MOSI]
//
// STM32F4DISC: init(pyb.SPI(2), pyb.Pin.cpu.A15, pyb.Pin.cpu.B10, pyb.Pin.cpu.B11)
-STATIC mp_obj_t cc3k_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t cc3k_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 4, 4, false);
diff --git a/stmhal/modnwwiznet5k.c b/stmhal/modnwwiznet5k.c
index f349e40aff..04d37cceef 100644
--- a/stmhal/modnwwiznet5k.c
+++ b/stmhal/modnwwiznet5k.c
@@ -318,7 +318,7 @@ STATIC mp_obj_t wiznet5k_socket_disconnect(mp_obj_t self_in) {
/// \classmethod \constructor(spi, pin_cs, pin_rst)
/// Create and return a WIZNET5K object.
-STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 3, 3, false);
diff --git a/stmhal/modusocket.c b/stmhal/modusocket.c
index afc2462dff..7ff8902640 100644
--- a/stmhal/modusocket.c
+++ b/stmhal/modusocket.c
@@ -43,7 +43,7 @@
STATIC const mp_obj_type_t socket_type;
// constructor socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
-STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 4, false);
// create socket object (not bound to any NIC yet)
diff --git a/stmhal/pin.c b/stmhal/pin.c
index 21012d1865..9c4eb8ba10 100644
--- a/stmhal/pin.c
+++ b/stmhal/pin.c
@@ -244,7 +244,7 @@ STATIC mp_obj_t pin_obj_init_helper(const pin_obj_t *pin, mp_uint_t n_args, cons
/// \classmethod \constructor(id, ...)
/// Create a new Pin object associated with the id. If additional arguments are given,
/// they are used to initialise the pin. See `init`.
-STATIC mp_obj_t pin_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
// Run an argument through the mapper and return the result.
@@ -261,7 +261,7 @@ STATIC mp_obj_t pin_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uin
}
// fast method for getting/setting pin value
-STATIC mp_obj_t pin_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pin_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 1, false);
pin_obj_t *self = self_in;
if (n_args == 0) {
diff --git a/stmhal/rtc.c b/stmhal/rtc.c
index 9045a76bd2..4fa26d25bf 100644
--- a/stmhal/rtc.c
+++ b/stmhal/rtc.c
@@ -425,7 +425,7 @@ STATIC const pyb_rtc_obj_t pyb_rtc_obj = {{&pyb_rtc_type}};
/// \classmethod \constructor()
/// Create an RTC object.
-STATIC mp_obj_t pyb_rtc_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_rtc_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 0, 0, false);
diff --git a/stmhal/servo.c b/stmhal/servo.c
index 382b48f67a..dff5495822 100644
--- a/stmhal/servo.c
+++ b/stmhal/servo.c
@@ -185,7 +185,7 @@ STATIC void pyb_servo_print(const mp_print_t *print, mp_obj_t self_in, mp_print_
/// \classmethod \constructor(id)
/// Create a servo object. `id` is 1-4.
-STATIC mp_obj_t pyb_servo_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_servo_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, 1, false);
diff --git a/stmhal/spi.c b/stmhal/spi.c
index 670da360e9..234d4bab72 100644
--- a/stmhal/spi.c
+++ b/stmhal/spi.c
@@ -600,7 +600,7 @@ STATIC mp_obj_t pyb_spi_init_helper(const pyb_spi_obj_t *self, mp_uint_t n_args,
///
/// At the moment, the NSS pin is not used by the SPI driver and is free
/// for other use.
-STATIC mp_obj_t pyb_spi_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_spi_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
diff --git a/stmhal/timer.c b/stmhal/timer.c
index 5727a95b73..494045c28f 100644
--- a/stmhal/timer.c
+++ b/stmhal/timer.c
@@ -636,7 +636,7 @@ STATIC mp_obj_t pyb_timer_init_helper(pyb_timer_obj_t *self, mp_uint_t n_args, c
/// Construct a new timer object of the given id. If additional
/// arguments are given, then the timer is initialised by `init(...)`.
/// `id` can be 1 to 14, excluding 3.
-STATIC mp_obj_t pyb_timer_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_timer_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
diff --git a/stmhal/uart.c b/stmhal/uart.c
index abe413bbf3..81e6f69a58 100644
--- a/stmhal/uart.c
+++ b/stmhal/uart.c
@@ -717,7 +717,7 @@ STATIC mp_obj_t pyb_uart_init_helper(pyb_uart_obj_t *self, mp_uint_t n_args, con
/// - `UART(6)` is on `YA`: `(TX, RX) = (Y1, Y2) = (PC6, PC7)`
/// - `UART(3)` is on `YB`: `(TX, RX) = (Y9, Y10) = (PB10, PB11)`
/// - `UART(2)` is on: `(TX, RX) = (X3, X4) = (PA2, PA3)`
-STATIC mp_obj_t pyb_uart_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_uart_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
diff --git a/stmhal/usb.c b/stmhal/usb.c
index 95da04aba7..5ba5ddc6e7 100644
--- a/stmhal/usb.c
+++ b/stmhal/usb.c
@@ -353,7 +353,7 @@ STATIC void pyb_usb_vcp_print(const mp_print_t *print, mp_obj_t self_in, mp_prin
/// \classmethod \constructor()
/// Create a new USB_VCP object.
-STATIC mp_obj_t pyb_usb_vcp_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_usb_vcp_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 0, 0, false);
@@ -541,7 +541,7 @@ typedef struct _pyb_usb_hid_obj_t {
STATIC const pyb_usb_hid_obj_t pyb_usb_hid_obj = {{&pyb_usb_hid_type}};
-STATIC mp_obj_t pyb_usb_hid_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_usb_hid_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 0, 0, false);
diff --git a/stmhal/usrsw.c b/stmhal/usrsw.c
index 1e07a55340..5bf4cc767a 100644
--- a/stmhal/usrsw.c
+++ b/stmhal/usrsw.c
@@ -77,7 +77,7 @@ void pyb_switch_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t
/// \classmethod \constructor()
/// Create and return a switch object.
-STATIC mp_obj_t pyb_switch_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t pyb_switch_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// check arguments
mp_arg_check_num(n_args, n_kw, 0, 0, false);
@@ -91,7 +91,7 @@ STATIC mp_obj_t pyb_switch_make_new(const mp_obj_type_t *type, mp_uint_t n_args,
/// \method \call()
/// Return the switch state: `True` if pressed down, `False` otherwise.
-mp_obj_t pyb_switch_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
+mp_obj_t pyb_switch_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
// get switch state
mp_arg_check_num(n_args, n_kw, 0, 0, false);
return switch_get() ? mp_const_true : mp_const_false;