Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
69397de
Update project.py
alan840706 Feb 4, 2021
4e7c673
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
8a12976
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
27d3c31
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
b5e9665
Update config_defaults.mk
alan840706 Feb 4, 2021
fc264ee
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
f45f7c0
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
f21b664
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
42fb7b0
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
c858fc2
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
afaf429
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
f9cb005
Update config_defaults_kmodel_v4_support.mk
alan840706 Feb 4, 2021
e625b7d
Update project.py
alan840706 Feb 4, 2021
c745f40
Update machine_spi.c
alan840706 Aug 19, 2021
c0497a4
Update machine_spi.c
alan840706 Aug 19, 2021
75037f6
Update machine_spi.c
alan840706 Aug 19, 2021
f5cbf26
Update machine_spi.c
alan840706 Aug 19, 2021
ca477cb
Update machine_spi.c
alan840706 Aug 19, 2021
aecd4d8
Update machine_spi.c
alan840706 Aug 19, 2021
8029e17
Update machine_spi.c
alan840706 Aug 19, 2021
4baa889
Update machine_spi.c
alan840706 Aug 19, 2021
e5d1a48
Update machine_spi.c
alan840706 Aug 19, 2021
016bd6d
Update machine_spi.c
alan840706 Aug 19, 2021
ad23e99
Update sipeed_spi.c
alan840706 Aug 19, 2021
9d774bd
Update sipeed_spi.c
alan840706 Aug 19, 2021
a81250c
Update sipeed_spi.c
alan840706 Aug 19, 2021
5019894
Update sipeed_spi.c
alan840706 Aug 19, 2021
499981e
Update sipeed_spi.c
alan840706 Aug 19, 2021
251ab2b
Update sipeed_spi.c
alan840706 Aug 19, 2021
b1483f1
Update sipeed_spi.c
alan840706 Aug 19, 2021
839c99f
Update sipeed_spi.c
alan840706 Aug 19, 2021
09a58cc
Update sipeed_spi.c
alan840706 Aug 19, 2021
4e4b72b
Update sipeed_spi.c
alan840706 Aug 19, 2021
71e1a85
Update sipeed_spi.c
alan840706 Aug 19, 2021
d500595
Update sipeed_spi.c
alan840706 Aug 19, 2021
31ceff8
Update sipeed_spi.c
alan840706 Aug 20, 2021
3f9714d
Update sipeed_spi.c
alan840706 Aug 20, 2021
6d2b204
Update sipeed_spi.c
alan840706 Aug 20, 2021
85cc7b8
Update project.py
alan840706 Aug 20, 2021
14fd53e
Update project.py
alan840706 Aug 20, 2021
dd7e169
Update config_defaults_kmodel_v4_support.mk
alan840706 Aug 20, 2021
6617fb9
Update config_defaults_kmodel_v4_support.mk
alan840706 Aug 20, 2021
b8b08cf
Update config_defaults_kmodel_v4_support.mk
alan840706 Aug 20, 2021
1e6abde
Update config_defaults_kmodel_v4_support.mk
alan840706 Aug 21, 2021
ba7ada0
Update config_defaults_kmodel_v4_support.mk
alan840706 Aug 21, 2021
0bac2ce
Update imlib.c
alan840706 Sep 7, 2021
82c9340
Update imlib.c
alan840706 Sep 7, 2021
41018db
Update bmp.c
alan840706 Sep 7, 2021
c851ae4
Update bmp.c
alan840706 Sep 7, 2021
9489619
Update bmp.c
alan840706 Sep 7, 2021
f4ddaf8
Update bmp.c
alan840706 Sep 7, 2021
e3cd886
Update bmp.c
alan840706 Sep 7, 2021
95bb264
Update bmp.c
alan840706 Sep 7, 2021
8d10493
Update draw.c
alan840706 Dec 22, 2021
8b2d462
Update draw.c
alan840706 Dec 22, 2021
44d4620
Update draw.c
alan840706 Dec 22, 2021
ba4f611
Update draw.c
alan840706 Dec 22, 2021
224b5ba
Update draw.c
alan840706 Dec 22, 2021
d01e4b6
Update draw.c
alan840706 Dec 22, 2021
8e8c001
Update py_image.c
alan840706 Dec 22, 2021
44b7643
Update py_image.c
alan840706 Dec 22, 2021
f57b332
Update py_image.c
alan840706 Dec 22, 2021
3c7e275
Update py_image.c
alan840706 Dec 22, 2021
783874c
Create a
alan840706 Aug 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions components/kendryte_sdk/src/sipeed_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ void sipeed_spi_transfer_data_standard(spi_device_num_t spi_num, spi_chip_select
sipeed_spi_set_tmod(spi_num, SPI_TMOD_TRANS_RECV);

volatile spi_t *spi_handle = spi[spi_num];

uint8_t dfs_offset;
switch(spi_num){
case 0:
Expand Down Expand Up @@ -211,12 +210,14 @@ void sipeed_spi_transfer_data_standard(spi_device_num_t spi_num, spi_chip_select

}
}

while ((spi_handle->sr & 0x05) != 0x04)
;
while (rx_len)
{
fifo_len = spi_handle->rxflr;

//fifo_len = spi_handle->rxflr;
fifo_len = rx_len;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain the specific reason for the modification here


fifo_len = fifo_len < rx_len ? fifo_len : rx_len;
switch(frame_width)
{
Expand Down
1 change: 1 addition & 0 deletions components/micropython/a
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty file was added by mistake and needs to be cleaned up

4 changes: 3 additions & 1 deletion components/micropython/port/src/omv/img/bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <ff.h>
#include "vfs_wrapper.h"
Expand Down Expand Up @@ -229,7 +230,6 @@ void bmp_write_subimg(image_t *img, const char *path, rectangle_t *r)
mp_obj_t file = vfs_internal_open(path, "wb", &err);
if(file == MP_OBJ_NULL || err != 0)
mp_raise_OSError(err);

if (IM_IS_GS(img)) {
const int row_bytes = (((rect.w * 8) + 31) / 32) * 4;
const int data_size = (row_bytes * rect.h);
Expand Down Expand Up @@ -257,6 +257,7 @@ void bmp_write_subimg(image_t *img, const char *path, rectangle_t *r)
for (int i = 0; i < 256; i++) {
write_long_raise(file, ((i) << 16) | ((i) << 8) | i);
}
printf("OK1!\n");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to clean up unnecessary code

if ((rect.x == 0) && (rect.w == img->w) && (img->w == row_bytes)) {
write_data_raise(file, // Super Fast - Zoom, Zoom!
img->pixels + (rect.y * img->w),
Expand All @@ -270,6 +271,7 @@ void bmp_write_subimg(image_t *img, const char *path, rectangle_t *r)
}
}
} else {
printf("OK2!\n");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to clean up unnecessary code

const int row_bytes = (((rect.w * 16) + 31) / 32) * 4;
const int data_size = (row_bytes * rect.h);
const int waste = (row_bytes / sizeof(uint16_t)) - rect.w;
Expand Down
4 changes: 2 additions & 2 deletions components/micropython/port/src/omv/img/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2013-2018 Ibrahim Abdelkader <[email protected]> & Kwabena W. Agyeman <[email protected]>
* This work is licensed under the MIT license, see the file LICENSE for details.
*/

#include <stdio.h>
#include "font.h"
#include "imlib.h"

Expand Down Expand Up @@ -31,7 +31,7 @@ int imlib_get_pixel(image_t *img, int x, int y)

// Set pixel (handles boundary check and image type check).
void imlib_set_pixel(image_t *img, int x, int y, int p)
{
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary trailing space

if ((0 <= x) && (x < img->w) && (0 <= y) && (y < img->h)) {
switch(img->bpp) {
case IMAGE_BPP_BINARY: {
Expand Down
4 changes: 4 additions & 0 deletions components/micropython/port/src/omv/py/py_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,18 +652,22 @@ STATIC mp_obj_t py_image_set_pixel(size_t n_args, const mp_obj_t *args, mp_map_t
switch (arg_img->bpp) {
case IMAGE_BPP_BINARY: {
IMAGE_PUT_BINARY_PIXEL(arg_img, arg_x, arg_y, arg_c);
//printf("0");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to clean up unnecessary code

return args[0];
}
case IMAGE_BPP_GRAYSCALE: {
IMAGE_PUT_GRAYSCALE_PIXEL(arg_img, arg_x, arg_y, arg_c);
//printf("1");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to clean up unnecessary code

return args[0];
}
case IMAGE_BPP_RGB565: {
IMAGE_PUT_RGB565_PIXEL(arg_img, arg_x, arg_y, arg_c);
//printf("2");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to clean up unnecessary code

return args[0];
}
case IMAGE_BPP_BAYER: {
IMAGE_PUT_GRAYSCALE_PIXEL(arg_img, arg_x, arg_y, arg_c); // Correct!
//printf("3");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to clean up unnecessary code

return args[0];
}
default: return args[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ void mp_soft_spi_transfer(void *self_in, size_t len, const uint8_t *src, uint8_t
machine_hw_spi_obj_t *self = (machine_hw_spi_obj_t*)self_in;
uint32_t delay_half = self->delay_half;

// printk("%s %d %d %d\r\n", __func__, self->pin_sck, self->pin_d[0], self->pin_d[1]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary trailing space


// only MSB transfer is implemented

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary trailing space

// If a port defines MICROPY_HW_SOFTSPI_MIN_DELAY, and the configured
// delay_half is equal to this value, then the software SPI implementation
// will run as fast as possible, limited only by CPU speed and GPIO time.
Expand Down Expand Up @@ -220,7 +220,6 @@ STATIC void machine_hw_spi_deinit(mp_obj_base_t *self_in) {

STATIC void machine_hw_spi_transfer(mp_obj_base_t *self_in, size_t len, const uint8_t *src, uint8_t *dest, int cs) {
machine_hw_spi_obj_t *self = MP_OBJ_TO_PTR(self_in);

if (self->state == MACHINE_HW_SPI_STATE_DEINIT) {
mp_raise_msg(&mp_type_OSError, "[MAIXPY]SPI: transfer on deinitialized SPI");
return;
Expand All @@ -231,6 +230,7 @@ STATIC void machine_hw_spi_transfer(mp_obj_base_t *self_in, size_t len, const ui
mp_soft_spi_transfer(self, len, src, dest);
return;
}

#endif
if(dest==NULL)
sipeed_spi_transfer_data_standard(self->id, cs, src, NULL, len, 0);
Expand Down Expand Up @@ -523,7 +523,7 @@ STATIC void mp_machine_spi_transfer(mp_obj_t self, size_t len, const void *src,
spi_p->transfer(s, len, src, dest, cs);
}

STATIC mp_obj_t mp_machine_spi_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
STATIC mp_obj_t mp_machine_spi_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary trailing space

enum {
ARG_write,
ARG_cs,
Expand Down Expand Up @@ -553,6 +553,7 @@ STATIC mp_obj_t mp_machine_spi_read(size_t n_args, const mp_obj_t *pos_args, mp_
vstr_t vstr;
vstr_init_len(&vstr, mp_obj_get_int(pos_args[1]));
memset(vstr.buf, args[ARG_write].u_int, vstr.len);

mp_machine_spi_transfer(self, vstr.len, vstr.buf, vstr.buf, cs);
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
}
Expand Down Expand Up @@ -722,4 +723,4 @@ const mp_obj_type_t machine_hw_spi_type = {
.locals_dict = (mp_obj_dict_t *) &mp_machine_spi_locals_dict,
};

#endif //MICROPY_PY_MACHINE_HW_SPI
#endif //MICROPY_PY_MACHINE_HW_SPI
2 changes: 1 addition & 1 deletion projects/maixpy_k210_minimum/config_defaults.mk
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ CONFIG_MAIXPY_OMV_DOUBLE_BUFF=y
# CONFIG_MAIXPY_WS2812_ENABLE is not set
# CONFIG_MAIXPY_HTPA_ENABLE is not set
# CONFIG_MICROPYTHON_ULAB_ENALBE is not set
# CONFIG_MICROPYTHON_KMODEL_V4_SUPPORT is not set
CONFIG_MICROPYTHON_KMODEL_V4_SUPPORT=y
# CONFIG_MAIXPY_SPEECH_RECOGNIZER_ENABLE is not set
# CONFIG_MICROPY_SSL_ENABLE is not set
# end of Modules configurations
Expand Down
20 changes: 10 additions & 10 deletions projects/maixpy_k210_minimum/config_defaults_kmodel_v4_support.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CONFIG_SENSOR_FREQ=24000000
CONFIG_CPU_DEFAULT_FREQ=400000000
# end of Board config

CONFIG_COMPONENT_DRIVERS_ENABLE=y
CONFIG_COMPONENT_DRIVERS_ENABLE=n

#
# Drivers configuration
Expand All @@ -33,7 +33,7 @@ CONFIG_COMPONENT_DRIVERS_ENABLE=y
#
# SD card
#
CONFIG_SPI_SD_CARD_FORCE_HIGH_SPEED=y
CONFIG_SPI_SD_CARD_FORCE_HIGH_SPEED=n
# end of SD card

#
Expand All @@ -49,7 +49,7 @@ CONFIG_SPI_SD_CARD_FORCE_HIGH_SPEED=y
# end of HTPA thermal sensor
# end of Drivers configuration

CONFIG_COMPONENT_KENDRYTE_SDK_ENABLE=y
CONFIG_COMPONENT_KENDRYTE_SDK_ENABLE=n

#
# Kendryte SDK configurations
Expand All @@ -69,7 +69,7 @@ CONFIG_MAIXPY_GC_HEAP_SIZE=0x80000
#
# Modules configurations
#
# CONFIG_MAIXPY_IDE_SUPPORT is not set
CONFIG_MAIXPY_IDE_SUPPORT=y
# CONFIG_MAIXPY_THREAD_ENABLE is not set
# CONFIG_MAIXPY_NES_ENABLE is not set
# CONFIG_MAIXPY_VIDEO_ENABLE is not set
Expand Down Expand Up @@ -111,7 +111,7 @@ CONFIG_BUILTIN_PY_DIR=""
# CONFIG_COMPONENT_LIB_SIPEED_KPU_SRC_ENABLE is not set
# end of Others

CONFIG_COMPONENT_SPIFFS_ENABLE=y
CONFIG_COMPONENT_SPIFFS_ENABLE=n

#
# SPIFFS Configuration
Expand All @@ -120,8 +120,8 @@ CONFIG_COMPONENT_SPIFFS_ENABLE=y
#
# SPIFFS Cache Configuration
#
CONFIG_SPIFFS_CACHE=y
CONFIG_SPIFFS_CACHE_WR=y
CONFIG_SPIFFS_CACHE=n
CONFIG_SPIFFS_CACHE_WR=n
# CONFIG_SPIFFS_CACHE_STATS is not set
# end of SPIFFS Cache Configuration

Expand All @@ -131,8 +131,8 @@ CONFIG_SPIFFS_EREASE_SIZE=0x1000
CONFIG_SPIFFS_LOGICAL_BLOCK_SIZE=0x20000
CONFIG_SPIFFS_LOGICAL_PAGE_SIZE=0x1000
CONFIG_SPIFFS_OBJ_NAME_LEN=128
CONFIG_SPIFFS_USE_MAGIC=y
CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
CONFIG_SPIFFS_USE_MAGIC=n
CONFIG_SPIFFS_USE_MAGIC_LENGTH=n
CONFIG_SPIFFS_META_LENGTH=0

#
Expand All @@ -146,7 +146,7 @@ CONFIG_SPIFFS_META_LENGTH=0
# end of Debug Configuration
# end of SPIFFS Configuration

CONFIG_COMPONENT_UTILS_ENABLE=y
CONFIG_COMPONENT_UTILS_ENABLE=n
# end of Components configuration

#
Expand Down
4 changes: 2 additions & 2 deletions tools/cmake/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
metavar='PREFIX',
default="")
project_parser.add_argument('--config_file',
help='config file path, e.g. config_defaults.mk',
help='config file path, e.g. config_with_ide_support.mk',
metavar='PATH',
default="{}/config_defaults.mk".format(project_path))
default="{}/config_defaults_kmodel_v4_support.mk".format(project_path))
project_parser.add_argument('--verbose',
help='for build command, execute `make VERBOSE=1` to compile',
action="store_true",
Expand Down