diff --git a/.github/workflows/ports_psoc6.yml b/.github/workflows/ports_psoc6.yml index 02247a5698f9f..3fbbc76302a89 100644 --- a/.github/workflows/ports_psoc6.yml +++ b/.github/workflows/ports_psoc6.yml @@ -106,6 +106,6 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 with: - name: Micropython PSoC6 ${{ github.ref_name }} + name: MicroPython PSoC6 ${{ github.ref_name }} files: mpy-psoc6_${{ matrix.board }}.hex body: ${{steps.build_changelog.outputs.changelog}} \ No newline at end of file diff --git a/ports/psoc6/machine_spi.c b/ports/psoc6/machine_spi.c index 23fc913539326..f584eac41680d 100644 --- a/ports/psoc6/machine_spi.c +++ b/ports/psoc6/machine_spi.c @@ -145,12 +145,14 @@ static inline void spi_obj_free(machine_spi_obj_t *spi_obj_ptr) { static inline void spi_init(machine_spi_obj_t *machine_spi_obj, int spi_mode) { cyhal_spi_mode_t mode = spi_mode_select(machine_spi_obj->firstbit, machine_spi_obj->polarity, machine_spi_obj->phase); - // set the baudrate - cyhal_spi_set_frequency(&machine_spi_obj->spi_obj, machine_spi_obj->baudrate); + // Initialise the SPI peripheral if any arguments given, or it was not initialised previously. cy_rslt_t result = cyhal_spi_init(&machine_spi_obj->spi_obj, machine_spi_obj->mosi, machine_spi_obj->miso, machine_spi_obj->sck, machine_spi_obj->ssel, NULL, machine_spi_obj->bits, mode, spi_mode); assert_pin_phy_used(result); spi_assert_raise_val("SPI initialisation failed with return code %x !", result); + + // set the baudrate + cyhal_spi_set_frequency(&machine_spi_obj->spi_obj, machine_spi_obj->baudrate); } static void machine_spi_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { diff --git a/tools/psoc6/mpy-psoc6.py b/tools/psoc6/mpy-psoc6.py index 0773e74ea2f2a..f92479ab7b61a 100644 --- a/tools/psoc6/mpy-psoc6.py +++ b/tools/psoc6/mpy-psoc6.py @@ -560,7 +560,7 @@ def __call__(self, parser, namespace, values, option_string, **kwargs): parser.exit() main_parser_desc = """ - Micropython PSoC6 utility script + MicroPython PSoC6 utility script Available commands: