mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/code][mpy][makefile] Fix size error on n0100 (#30)
This commit is contained in:
committed by
GitHub
parent
8c949d7048
commit
0a5e9e0889
17
Makefile
17
Makefile
@@ -13,7 +13,18 @@ include build/variants.mak
|
||||
include build/helpers.mk
|
||||
|
||||
ifeq (${MODEL}, n0100)
|
||||
EPSILON_APPS := $(filter-out reader,$(EPSILON_APPS))
|
||||
ifeq ($(filter reader,$(apps_list)),)
|
||||
$(warning reader app included, removing it on n0100. )
|
||||
EPSILON_APPS := $(filter-out reader,$(EPSILON_APPS))
|
||||
endif
|
||||
ifneq ($(words $(EPSILON_I18N)), 1)
|
||||
$(warning Only use 1 language on n0100, defaulting to en. )
|
||||
EPSILON_I18N := en
|
||||
endif
|
||||
ifeq ($(INCLUDE_ULAB), 1)
|
||||
$(warning Removing uLab on n0100. )
|
||||
INCLUDE_ULAB := 0
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (${MODEL}, n0110)
|
||||
@@ -26,6 +37,10 @@ ifdef FORCE_EXTERNAL
|
||||
apps_list = ${EPSILON_APPS}
|
||||
endif
|
||||
|
||||
ifeq ($(INCLUDE_ULAB), 1)
|
||||
SFLAGS += -DINCLUDE_ULAB
|
||||
endif
|
||||
|
||||
ifdef HOME_DISPLAY_EXTERNALS
|
||||
ifneq ($(filter external,$(apps_list)),)
|
||||
SFLAGS += -DHOME_DISPLAY_EXTERNALS
|
||||
|
||||
@@ -135,7 +135,9 @@ const ToolboxMessageTree MatplotlibPyplotModuleChildren[] = {
|
||||
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGray, I18n::Message::PythonColorGray, false)
|
||||
};
|
||||
|
||||
const ToolboxMessageTree NumpyNdarrayModuleChildren[] = {
|
||||
#if defined(INCLUDE_ULAB)
|
||||
|
||||
const ToolboxMessageTree NumpyNdarrayModuleChildren[] = {
|
||||
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyArray),
|
||||
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyArange),
|
||||
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandNumpyConcatenate),
|
||||
@@ -254,7 +256,6 @@ const ToolboxMessageTree NumpyModuleChildren[] = {
|
||||
ToolboxMessageTree::Node(I18n::Message::NumpyLinalgModule, NumpyLinalgModuleChildren)
|
||||
};
|
||||
|
||||
#if !defined(DEVICE_N0100)
|
||||
const ToolboxMessageTree ScipyLinalgModuleChildren[] = {
|
||||
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyLinalgFunction, I18n::Message::PythonScipyLinalgFunction, false, I18n::Message::PythonCommandScipyLinalgFunctionWithoutArg),
|
||||
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyLinalgChoSolve),
|
||||
@@ -291,16 +292,14 @@ const ToolboxMessageTree ScipyModuleChildren[] = {
|
||||
ToolboxMessageTree::Node(I18n::Message::ScipySpecialModule, ScipySpecialModuleChildren),
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
const ToolboxMessageTree UlabModuleChildren[] = {
|
||||
ToolboxMessageTree::Node(I18n::Message::NumpyModule, NumpyModuleChildren),
|
||||
#if !defined(DEVICE_N0100)
|
||||
ToolboxMessageTree::Node(I18n::Message::ScipyModule, ScipyModuleChildren),
|
||||
#endif
|
||||
ToolboxMessageTree::Leaf(I18n::Message::UlabDocumentation, I18n::Message::UlabDocumentationLink)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
const ToolboxMessageTree TurtleModuleChildren[] = {
|
||||
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportTurtle, I18n::Message::PythonImportTurtle, false),
|
||||
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromTurtle, I18n::Message::PythonImportTurtle, false),
|
||||
@@ -406,7 +405,9 @@ const ToolboxMessageTree modulesChildren[] = {
|
||||
ToolboxMessageTree::Node(I18n::Message::MathModule, MathModuleChildren),
|
||||
ToolboxMessageTree::Node(I18n::Message::CmathModule, CMathModuleChildren),
|
||||
ToolboxMessageTree::Node(I18n::Message::MatplotlibPyplotModule, MatplotlibPyplotModuleChildren),
|
||||
#if defined(INCLUDE_ULAB)
|
||||
ToolboxMessageTree::Node(I18n::Message::UlabModule, UlabModuleChildren),
|
||||
#endif
|
||||
ToolboxMessageTree::Node(I18n::Message::TurtleModule, TurtleModuleChildren),
|
||||
ToolboxMessageTree::Node(I18n::Message::RandomModule, RandomModuleChildren),
|
||||
ToolboxMessageTree::Node(I18n::Message::KandinskyModule, KandinskyModuleChildren),
|
||||
@@ -678,9 +679,11 @@ KDCoordinate PythonToolbox::rowHeight(int j) {
|
||||
|
||||
bool PythonToolbox::selectLeaf(int selectedRow) {
|
||||
ToolboxMessageTree * node = (ToolboxMessageTree *)m_messageTreeModel->childAtIndex(selectedRow);
|
||||
#if defined(INCLUDE_ULAB)
|
||||
if(node->text() == I18n::Message::UlabDocumentationLink){
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
m_selectableTableView.deselectTable();
|
||||
if(node->insertedText() == I18n::Message::IonSelector){
|
||||
m_ionKeys.setSender(sender());
|
||||
|
||||
@@ -16,3 +16,4 @@ EPSILON_GETOPT ?= 0
|
||||
ESCHER_LOG_EVENTS_BINARY ?= 0
|
||||
THEME_NAME ?= omega_light
|
||||
THEME_REPO ?= local
|
||||
INCLUDE_ULAB ?= 1
|
||||
|
||||
@@ -154,6 +154,11 @@ port_src += $(addprefix python/port/,\
|
||||
mod/turtle/modturtle.cpp \
|
||||
mod/turtle/modturtle_table.c \
|
||||
mod/turtle/turtle.cpp \
|
||||
mphalport.c \
|
||||
)
|
||||
|
||||
ifeq ($(INCLUDE_ULAB), 1)
|
||||
port_src += $(addprefix python/port/,\
|
||||
mod/ulab/scipy/linalg/linalg.c \
|
||||
mod/ulab/scipy/optimize/optimize.c \
|
||||
mod/ulab/scipy/signal/signal.c \
|
||||
@@ -180,8 +185,8 @@ port_src += $(addprefix python/port/,\
|
||||
mod/ulab/user/user.c \
|
||||
mod/ulab/utils/utils.c \
|
||||
mod/ulab/ulab.c \
|
||||
mphalport.c \
|
||||
)
|
||||
endif
|
||||
|
||||
# Workarounds
|
||||
|
||||
|
||||
@@ -604,6 +604,7 @@ Q(username)
|
||||
Q(rename)
|
||||
Q(listdir)
|
||||
|
||||
#if defined(INCLUDE_ULAB)
|
||||
// ulab QSTRs
|
||||
Q(threshold)
|
||||
Q(edgeitems)
|
||||
@@ -721,3 +722,4 @@ Q(from_int16_buffer)
|
||||
Q(from_uint16_buffer)
|
||||
Q(from_int32_buffer)
|
||||
Q(from_uint32_buffer)
|
||||
#endif
|
||||
|
||||
@@ -34,13 +34,7 @@
|
||||
|
||||
// Determines, whether scipy is defined in ulab. The sub-modules and functions
|
||||
// of scipy have to be defined separately
|
||||
#ifndef ULAB_HAS_SCIPY
|
||||
#if defined(DEVICE_N0100)
|
||||
#define ULAB_HAS_SCIPY (0)
|
||||
#else
|
||||
#define ULAB_HAS_SCIPY (1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// The maximum number of dimensions the firmware should be able to support
|
||||
// Possible values lie between 1, and 4, inclusive
|
||||
|
||||
@@ -136,6 +136,19 @@ extern const struct _mp_obj_module_t modpyplot_module;
|
||||
extern const struct _mp_obj_module_t modtime_module;
|
||||
extern const struct _mp_obj_module_t modos_module;
|
||||
extern const struct _mp_obj_module_t modturtle_module;
|
||||
|
||||
#if !defined(INCLUDE_ULAB)
|
||||
|
||||
#define MICROPY_PORT_BUILTIN_MODULES \
|
||||
{ MP_ROM_QSTR(MP_QSTR_ion), MP_ROM_PTR(&modion_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_kandinsky), MP_ROM_PTR(&modkandinsky_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_matplotlib), MP_ROM_PTR(&modmatplotlib_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_matplotlib_dot_pyplot), MP_ROM_PTR(&modpyplot_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&modtime_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_os), MP_ROM_PTR(&modos_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_turtle), MP_ROM_PTR(&modturtle_module) }, \
|
||||
|
||||
#else
|
||||
extern const struct _mp_obj_module_t ulab_user_cmodule;
|
||||
|
||||
#define MICROPY_PORT_BUILTIN_MODULES \
|
||||
@@ -146,7 +159,10 @@ extern const struct _mp_obj_module_t ulab_user_cmodule;
|
||||
{ MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&modtime_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_os), MP_ROM_PTR(&modos_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_turtle), MP_ROM_PTR(&modturtle_module) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) }, \
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// Enable setjmp in debug mode. This is to avoid some optimizations done
|
||||
// specifically for x86_64 using inline assembly, which makes the debug binary
|
||||
|
||||
@@ -61,7 +61,9 @@ extern "C" {
|
||||
#include "mphalport.h"
|
||||
#include "mod/turtle/modturtle.h"
|
||||
#include "mod/matplotlib/pyplot/modpyplot.h"
|
||||
#if defined(INCLUDE_ULAB)
|
||||
#include "mod/ulab/ulab.h"
|
||||
#endif
|
||||
}
|
||||
|
||||
#include <escher/palette.h>
|
||||
|
||||
Reference in New Issue
Block a user