diff --git a/mrbgems/hw-gpio/README.md b/mrbgems/hw-gpio/README.md index 43b15a898..f464a792f 100644 --- a/mrbgems/hw-gpio/README.md +++ b/mrbgems/hw-gpio/README.md @@ -36,14 +36,14 @@ end These flags can be combined with bitwise OR. -| Flag | Value | Description | -|---------------------|--------|----------------------------| -| `GPIO::IN` | `0x01` | Input mode | -| `GPIO::OUT` | `0x02` | Output mode | -| `GPIO::HIGH_Z` | `0x04` | High-impedance (tri-state) | -| `GPIO::PULL_UP` | `0x08` | Enable pull-up resistor | -| `GPIO::PULL_DOWN` | `0x10` | Enable pull-down resistor | -| `GPIO::OPEN_DRAIN` | `0x20` | Enable open-drain output | +| Flag | Value | Description | +| ------------------ | ------ | -------------------------- | +| `GPIO::IN` | `0x01` | Input mode | +| `GPIO::OUT` | `0x02` | Output mode | +| `GPIO::HIGH_Z` | `0x04` | High-impedance (tri-state) | +| `GPIO::PULL_UP` | `0x08` | Enable pull-up resistor | +| `GPIO::PULL_DOWN` | `0x10` | Enable pull-down resistor | +| `GPIO::OPEN_DRAIN` | `0x20` | Enable open-drain output | ### GPIO.new diff --git a/mrbgems/hw-i2c/README.md b/mrbgems/hw-i2c/README.md index fe10f5aa7..768c07306 100644 --- a/mrbgems/hw-i2c/README.md +++ b/mrbgems/hw-i2c/README.md @@ -44,10 +44,10 @@ i2c = I2C.new( #### Unit Names -| Platform | Available Units | -|----------|---------------------------------| -| ESP32 | `:ESP32_I2C0`, `:ESP32_I2C1` | -| RP2040 | `:RP2040_I2C0`, `:RP2040_I2C1` | +| Platform | Available Units | +| -------- | ------------------------------ | +| ESP32 | `:ESP32_I2C0`, `:ESP32_I2C1` | +| RP2040 | `:RP2040_I2C0`, `:RP2040_I2C1` | On RP2040, if `sda_pin` or `scl_pin` is -1, the Pico SDK default pins are used. diff --git a/mrbgems/hw-spi/README.md b/mrbgems/hw-spi/README.md index d7ef90a30..50d5e78af 100644 --- a/mrbgems/hw-spi/README.md +++ b/mrbgems/hw-spi/README.md @@ -42,11 +42,11 @@ spi = SPI.new( #### Unit Names -| Platform | Available Units | -|----------|-----------------------------------------------------| -| ESP32 | `:ESP32_SPI2_HOST`, `:ESP32_HSPI_HOST`, | -| | `:ESP32_SPI3_HOST`\*, `:ESP32_VSPI_HOST`\* | -| RP2040 | `:RP2040_SPI0`, `:RP2040_SPI1` | +| Platform | Available Units | +| -------- | ------------------------------------------ | +| ESP32 | `:ESP32_SPI2_HOST`, `:ESP32_HSPI_HOST`, | +| | `:ESP32_SPI3_HOST`\*, `:ESP32_VSPI_HOST`\* | +| RP2040 | `:RP2040_SPI0`, `:RP2040_SPI1` | \*SPI3 availability depends on ESP32 variant. diff --git a/mrbgems/hw-uart/README.md b/mrbgems/hw-uart/README.md index 502aa5e5d..23769cb3a 100644 --- a/mrbgems/hw-uart/README.md +++ b/mrbgems/hw-uart/README.md @@ -35,13 +35,13 @@ end ### Constants -| Constant | Value | Description | -|-------------------------------|-------|---------------------| -| `UART::PARITY_NONE` | `0` | No parity | -| `UART::PARITY_EVEN` | `1` | Even parity | -| `UART::PARITY_ODD` | `2` | Odd parity | -| `UART::FLOW_CONTROL_NONE` | `0` | No flow control | -| `UART::FLOW_CONTROL_RTS_CTS` | `1` | Hardware flow ctrl | +| Constant | Value | Description | +| ---------------------------- | ----- | ------------------ | +| `UART::PARITY_NONE` | `0` | No parity | +| `UART::PARITY_EVEN` | `1` | Even parity | +| `UART::PARITY_ODD` | `2` | Odd parity | +| `UART::FLOW_CONTROL_NONE` | `0` | No flow control | +| `UART::FLOW_CONTROL_RTS_CTS` | `1` | Hardware flow ctrl | ### UART.new @@ -62,7 +62,7 @@ uart = UART.new( #### Unit Names | Platform | Available Units | -|----------|--------------------------------------------------| +| -------- | ------------------------------------------------ | | ESP32 | `:ESP32_UART0`, `:ESP32_UART1`, `:ESP32_UART2`\* | | RP2040 | `:RP2040_UART0`, `:RP2040_UART1` | diff --git a/oss-fuzz/mruby_irep_fuzzer.c b/oss-fuzz/mruby_irep_fuzzer.c index 8eddaea03..42329ea7e 100644 --- a/oss-fuzz/mruby_irep_fuzzer.c +++ b/oss-fuzz/mruby_irep_fuzzer.c @@ -11,10 +11,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t size) { if (!mrb) { return 0; } - + /* mrb_load_irep_buf returns the result of the last expression */ mrb_load_irep_buf(mrb, Data, size); - + mrb_close(mrb); return 0; } diff --git a/oss-fuzz/mruby_numeric_fuzzer.c b/oss-fuzz/mruby_numeric_fuzzer.c index ac6786425..15ad4a9c1 100644 --- a/oss-fuzz/mruby_numeric_fuzzer.c +++ b/oss-fuzz/mruby_numeric_fuzzer.c @@ -39,12 +39,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t size) { case 0: mrb_funcall(mrb, b1, "+", 1, b2); break; case 1: mrb_funcall(mrb, b1, "-", 1, b2); break; case 2: mrb_funcall(mrb, b1, "*", 1, b2); break; - case 3: + case 3: if (mrb_test(mrb_funcall(mrb, b2, "!=", 1, mrb_fixnum_value(0)))) { mrb_funcall(mrb, b1, "/", 1, b2); } break; - case 4: + case 4: if (mrb_test(mrb_funcall(mrb, b2, "<", 1, mrb_fixnum_value(1000)))) { mrb_funcall(mrb, b1, "**", 1, b2); } diff --git a/oss-fuzz/mruby_pack_fuzzer.c b/oss-fuzz/mruby_pack_fuzzer.c index 9ef58cc26..c2f578ab7 100644 --- a/oss-fuzz/mruby_pack_fuzzer.c +++ b/oss-fuzz/mruby_pack_fuzzer.c @@ -17,10 +17,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t size) { if (fmt_len > size - 1) { fmt_len = size - 1; } - + mrb_value fmt = mrb_str_new(mrb, (const char *)(Data + 1), fmt_len); mrb_value str = mrb_str_new(mrb, (const char *)(Data + 1 + fmt_len), size - 1 - fmt_len); - + /* Target String#unpack */ mrb_funcall(mrb, str, "unpack", 1, fmt); diff --git a/oss-fuzz/mruby_sprintf_fuzzer.c b/oss-fuzz/mruby_sprintf_fuzzer.c index b6b4b701a..53df2c1a3 100644 --- a/oss-fuzz/mruby_sprintf_fuzzer.c +++ b/oss-fuzz/mruby_sprintf_fuzzer.c @@ -19,9 +19,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t size) { if (fmt_len > size - 1) { fmt_len = size - 1; } - + mrb_value fmt = mrb_str_new(mrb, (const char *)(Data + 1), fmt_len); - + /* provide some arguments of different types to satisfy various format specifiers */ mrb_value args[5]; args[0] = mrb_fixnum_value(123); @@ -29,7 +29,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t size) { args[2] = mrb_str_new_cstr(mrb, "fuzz"); args[3] = mrb_symbol_value(mrb_intern_cstr(mrb, "symbol")); args[4] = mrb_ary_new(mrb); - + /* Call sprintf via mrb_funcall */ /* We don't use all args every time, but it doesn't hurt to pass them */ mrb_funcall(mrb, mrb_obj_value(mrb->kernel_module), "sprintf", 6, fmt, args[0], args[1], args[2], args[3], args[4]);