Go to file
Phil Hord 9d42fa4ac1 Configtool: speed up startup with wx-tricks.
This should fix issue #235.

Recently ConfigTool has been very slow for me on Ubuntu Linux.
When I run the app there is a 15 second wait before the window is
first displayed.  I bisected the problem and found it was tied to
the number of pins in `pinNames`, and ultimately that it was
caused by a slow initializer in wx.Choice() when the choices are
loaded when the widget is created.  For some reason, moving the
load after the widget is created is significantly faster.  This
change reduces my startup time to just under 4 seconds.

Further speedup could be had by using lazy initialization of the
controls.  But the controls are too bound up in the loaded data
to make this simple.  Maybe I will attack it later.

There is still a significant delay when closing the window, but I
haven't tracked what causes it.  Maybe it is caused just by
destroying all these pin controls.

In the process of making this change, I wanted to simplify the
number of locations that bothered to copy the pinNames list and,
to support lazy loading, to try to keep the same list in all
pinChoice controls.  I noticed that all the pinChoice controls
already have the same parameters passed to the addPinChoice
function which makes them redundant and confusing.  I removed the
extra initializers and just rely on pinNames as the only list
option in addPinChoice for now.  Maybe this flexibility is needed
for some reason later, but I can't see a purpose for it now.

Notes by reviewer Traumflug:

First of all, which "trick"? That's an excellent code
simplification and if this happens to make startup faster (it
does), all the better.

Measured startup & shutdown time here (click window close as soon
as it appears):

  Before:                With this commit:
  real    0m4.222s       real    0m3.780s
  user    0m3.864s       user    0m3.452s
  sys     0m0.084s       sys     0m0.100s

As the speedup was far more significant on the commit author's
machine, it might be a memory consumption issue (leading to
swapping on a small RAM machine). Linux allows to view this in
/proc/<pid>/status.

         Before:          Now:
VmPeak:	  708360 kB     708372 kB
VmSize:	  658916 kB     658756 kB
VmHWM:	   73792 kB      73492 kB
VmRSS:	   73792 kB      73492 kB
VmData:	  402492 kB     402332 kB

Still no obvious indicator, but a 300 kB smaller memory footprint
is certainly nice.
2016-10-26 22:00:21 +02:00
attic Attic: gzip single file storage. 2016-06-12 19:30:54 +02:00
config Config files: update comment/help text for USE_INTERNAL_PULLUPS. 2016-09-30 13:51:01 +02:00
configtool Configtool: speed up startup with wx-tricks. 2016-10-26 22:00:21 +02:00
extruder pinio.h: remove TOGGLE(), GET_INPUT(), GET_OUTPUT() macros. 2015-08-12 14:26:35 +02:00
research Add gnuplot script to explore simulator output 2013-12-06 19:24:58 +01:00
simulator simulator: suppress position display unless something changed 2016-05-31 15:21:49 -04:00
testcases Config files: update comment/help text for USE_INTERNAL_PULLUPS. 2016-09-30 13:51:01 +02:00
tools git-regtest: abort on regression test failure. 2016-04-20 21:46:37 +02:00
.gitattributes Enforce Unix line endings (LF). 2015-02-04 00:10:37 +01:00
.gitignore .gitignore: add entries for Atmel Studio project files. 2016-04-14 23:04:05 +02:00
Doxyfile Remove LUFA. 2012-12-03 19:48:54 +01:00
LICENSE licensing- GPL-2 at the moment 2010-10-20 18:15:09 +11:00
Makefile-ARM board.gen7-arm.h: adjust for the released Gen7-ARM. 2016-03-27 20:36:03 +02:00
Makefile-AVR Makefile-AVR: correct reported program sizes. 2016-04-21 19:19:29 +02:00
Makefile-SIM Makefiles: add a hint on how to list these predefined macros. 2015-08-12 14:26:34 +02:00
Makefile-common Regressiontests: define $MCU and $F_CPU explicitely on all tests. 2016-07-09 14:15:40 +02:00
Makefile-example Makefile-example: add shortcut targets. 2015-07-17 13:29:22 +02:00
README Makefiles: adjust comments. 2015-04-21 02:51:31 +02:00
README.sim Teach simulator to process gcode files directly 2013-12-06 19:24:58 +01:00
Teacup_Firmware.pde arduino ide: .pde must have the same name as the folder. 2011-02-27 22:08:41 +01:00
analog-arm.c analog-arm.c: read not by ADC channel number, but by Teacup number. 2015-08-12 14:26:37 +02:00
analog-avr.c analog-avr.c: no need to re-initialise adc_counter. 2016-06-23 22:34:31 +02:00
analog.c analog-arm.c: read not by ADC channel number, but by Teacup number. 2015-08-12 14:26:37 +02:00
analog.h Temp: request ADC reads only when necessary. 2016-06-23 22:32:51 +02:00
arduino.h Simulator: fix pin numbering consistency 2016-05-26 11:04:30 +02:00
arduino_32U4.h SD card: establish spi.c/.h and sd.c/.h and get SPI running. 2015-07-05 23:32:46 +02:00
arduino_168_328p.h SD card: establish spi.c/.h and sd.c/.h and get SPI running. 2015-07-05 23:32:46 +02:00
arduino_644.h SD card: establish spi.c/.h and sd.c/.h and get SPI running. 2015-07-05 23:32:46 +02:00
arduino_1280.h SD card: establish spi.c/.h and sd.c/.h and get SPI running. 2015-07-05 23:32:46 +02:00
arduino_lpc1114.h ARM: allow non-PWM pins as heater output. 2015-08-13 16:41:33 +02:00
arduino_usb1286.h SD card: establish spi.c/.h and sd.c/.h and get SPI running. 2015-07-05 23:32:46 +02:00
arduino_usb1287.h SD card: establish spi.c/.h and sd.c/.h and get SPI running. 2015-07-05 23:32:46 +02:00
calc.pl setting up new branch 2 2010-08-10 14:26:24 +10:00
clock.c Temp: have residency updates on 1s clock. 2016-06-23 22:32:51 +02:00
clock.h clock.c: make stuff used only in clock.c static to this file. 2015-08-01 16:22:10 +02:00
cmsis-core_cm0.h ARM: prettify cmsis-core_cm0.h. 2015-08-12 14:26:36 +02:00
cmsis-lpc11xx.h ARM: rename mbed-system_LPC11xx.c/.h to cmsis-system_lpc11xx.c/.h. 2015-08-12 14:26:36 +02:00
cmsis-lpc1114.ld ARM: prettify current cmsis- files. 2015-08-12 14:26:35 +02:00
cmsis-startup_lpc11xx.s ARM: prettify current cmsis- files. 2015-08-12 14:26:35 +02:00
cmsis-system_lpc11xx.c ARM: prettify cmsis-system_lpc11xx.c/.h. 2015-08-12 14:26:36 +02:00
cmsis-system_lpc11xx.h ARM: prettify cmsis-system_lpc11xx.c/.h. 2015-08-12 14:26:36 +02:00
config.default.h Configtool: convert template for Teensy++ 2.0. 2015-04-21 02:51:31 +02:00
config_wrapper.h Lookahead: disable in config_wrapper.h, not in dda_lookahead.h. 2016-07-09 13:36:22 +02:00
configtool.default.ini Configtool: move thermistor presets into distribution file. 2015-05-20 23:31:38 +02:00
configtool.py Configtool: add --quit and --save commandline switches. 2016-06-06 12:36:17 +02:00
cpu-arm.c ARM: take care of system startup status. 2015-08-13 17:12:13 +02:00
cpu-avr.c I2C: initial support. 2016-04-20 21:15:11 +02:00
cpu.c ARM: get a minimum amount of Teacup compiled for ARM. 2015-08-12 14:26:33 +02:00
cpu.h ARM: introduce sei() and cli(). 2015-08-12 14:26:36 +02:00
crc.c Replace SIMULATOR with __AVR__ in several places. 2015-07-29 21:05:38 +02:00
crc.h use CRC16 to verify heater PID settings in eeprom 2011-02-20 17:13:09 +11:00
createTemperatureLookup.py createTemperatureLookup.py: deal with precision limitation on R0. 2015-04-21 02:51:32 +02:00
dda.c M220: add support for feedrate override percentage. 2016-07-09 14:18:06 +02:00
dda.h M220: add support for feedrate override percentage. 2016-07-09 14:18:06 +02:00
dda_kinematics.c dda_create(): treat 'target' as const and input only. 2016-07-09 14:17:51 +02:00
dda_kinematics.h dda_create(): treat 'target' as const and input only. 2016-07-09 14:17:51 +02:00
dda_lookahead.c dda_lookahead.c: remove use_lookahead. 2016-10-21 21:55:11 +02:00
dda_lookahead.h dda_lookahead.c/.h: more debugging code removal/wrapping. 2016-09-06 21:50:33 +02:00
dda_maths.c Rename all these new PROGMEM variables to end in _P. 2014-08-31 19:05:25 +02:00
dda_maths.h DDA: have an acceleration constant for each axis individually. 2014-08-31 19:10:14 +02:00
dda_queue.c Make message/text sending aware of the sending destination. 2016-04-26 15:23:15 +02:00
dda_queue.h Remove __attribute__((hot)). 2014-03-04 19:56:13 +01:00
debug.c setting up new branch 2 2010-08-10 14:26:24 +10:00
debug.h Configtool: don't make DEBUG configuration user-visible. 2015-05-08 20:38:23 +02:00
delay-arm.c ARM: rename mbed-LPC11xx.h to cmsis-lpc11xx.h. 2015-08-12 14:26:36 +02:00
delay-avr.c ARM: split out architecture specific parts for delay.c 2015-08-12 14:26:35 +02:00
delay.c ARM: get delay.c in. 2015-08-12 14:26:35 +02:00
delay.h delay.h: re-add falsely removed #include. 2013-03-24 16:19:25 +01:00
display.c Display: queue up display_set_cursor(), too. 2016-05-30 10:59:12 +02:00
display.h Configtool: learn about DISPLAY_TYPE_HD44780. 2016-05-30 11:05:50 +02:00
display_hd44780.c display_hd44780.c: replace silly demo with temperatures. 2016-05-30 11:03:41 +02:00
display_ssd1306.c Display: queue up display_set_cursor(), too. 2016-05-30 10:59:12 +02:00
displaybus.h Display: add support for the HD44780 display. 2016-05-30 10:31:39 +02:00
extract.py Added gcode documentation and extraction tool 2011-06-03 02:02:46 +10:00
font.c Display: introduce font.h, paraphrase handling distinct fonts. 2016-04-26 14:13:20 +02:00
font.h Display: introduce font.h, paraphrase handling distinct fonts. 2016-04-26 14:13:20 +02:00
font_8x4.c Display: introduce font.h, paraphrase handling distinct fonts. 2016-04-26 14:13:20 +02:00
func.sh func.sh: Fix a potential infinite loop in mendel_readsym_target 2011-05-08 00:36:55 +10:00
gcode_parse.c Drop redundant "simulator.h" includes. 2016-06-11 15:12:40 +02:00
gcode_parse.h gcode_parse.h: order variables reasonably in groups of 4 bytes. 2015-08-12 14:26:36 +02:00
gcode_process.c M220: add support for feedrate override percentage. 2016-07-09 14:18:06 +02:00
gcode_process.h G-code parser: move gcode_source stuff ... 2015-07-17 13:31:10 +02:00
graycode.c disable greycode by default in arduino IDE 2011-02-17 21:52:15 +11:00
heater-arm.c ARM: enable temperature control. 2015-08-13 17:12:12 +02:00
heater-avr.c ARM: enable temperature control. 2015-08-13 17:12:12 +02:00
heater.c ARM: enable temperature control. 2015-08-13 17:12:12 +02:00
heater.h Drop redundant "simulator.h" includes. 2016-06-11 15:12:40 +02:00
home.c home.c, dda.c: consider endstops on both axis ends when homing. 2015-01-09 13:11:01 +01:00
home.h Fixed single inclusion of file. Added missing define. 2011-08-16 14:09:49 +02:00
i2c.c i2c.c: review error handling yet again. 2016-04-27 23:54:15 +02:00
i2c.h Display: introduce display queue. 2016-04-27 23:54:14 +02:00
intercom.c ARM: introduce sei() and cli(). 2015-08-12 14:26:36 +02:00
intercom.h Add config.h wrapper to simplify test automation 2014-03-04 19:56:23 +01:00
memory_barrier.h ARM: port memory_barrier.h. 2015-08-12 14:26:36 +02:00
mendel.c Drop redundant "simulator.h" includes. 2016-06-11 15:12:40 +02:00
mendel_cmd Merge release-candidate-triffid branch 2011-01-07 23:09:13 +11:00
msg.c Make message/text sending aware of the sending destination. 2016-04-26 15:23:15 +02:00
msg.h Make message/text sending aware of the sending destination. 2016-04-26 15:23:15 +02:00
parallel-4bit.c Display: add support for the HD44780 display. 2016-05-30 10:31:39 +02:00
parallel-4bit.h Display: add support for the HD44780 display. 2016-05-30 10:31:39 +02:00
pff.c SD card: move parsing closer to the metal. 2015-07-17 13:31:03 +02:00
pff.h Add simulator SD card (and SPI, PFF) support. 2015-07-17 16:02:59 +02:00
pff_conf.h SD card: measures sizes and additionally enable FAT32 support. 2015-07-07 19:07:37 +02:00
pff_diskio.c Fix typos: "whether" and whitespace. 2015-07-17 16:16:42 +02:00
pff_diskio.h SD card: move parsing closer to the metal. 2015-07-17 13:31:03 +02:00
pinio.c pinio.c/.h: rename PULLUP_OFF() to PULL_OFF(). 2016-09-30 12:42:47 +02:00
pinio.h pinio.h: support USE_INTERNAL_PULLDOWNS. 2016-09-30 13:16:01 +02:00
preprocessor_math.h preprocessor_math.h: fix errorneous comment. 2014-08-31 19:32:09 +02:00
ringbuffer.h Serial: move ringbuffer logic into a separate header file. 2016-04-20 21:15:11 +02:00
sd.c heater.c, sd.c: apply the changed order of SET_OUTPUT() here, too. 2015-08-12 14:26:36 +02:00
sd.h ARM: get spi.c, pff.c and pff_diskio.c (SD card handling) in. 2015-08-13 17:12:13 +02:00
sender-mac.sh sender-mac.sh: another minor fix. 2011-09-30 21:02:25 +02:00
sender.sh sender.sh: Allow for "ok" to be surrounded by DEBUG output. 2011-03-04 19:42:00 +11:00
sendf.c Make message/text sending aware of the sending destination. 2016-04-26 15:23:15 +02:00
sendf.h Simulator: fix pin numbering consistency 2016-05-26 11:04:30 +02:00
serial-arm.c Make message/text sending aware of the sending destination. 2016-04-26 15:23:15 +02:00
serial-avr.c Serial: move ringbuffer logic into a separate header file. 2016-04-20 21:15:11 +02:00
serial.c ARM: get a minimum amount of Teacup compiled for ARM. 2015-08-12 14:26:33 +02:00
serial.h Drop redundant "simulator.h" includes. 2016-06-11 15:12:40 +02:00
sermsg.h Make message/text sending aware of the sending destination. 2016-04-26 15:23:15 +02:00
sersendf.h Make message/text sending aware of the sending destination. 2016-04-26 15:23:15 +02:00
simulator.h Define missing DEBUG_LED_PIN in simulator 2016-08-08 13:34:39 -04:00
spi.c ARM: get spi.c, pff.c and pff_diskio.c (SD card handling) in. 2015-08-13 17:12:13 +02:00
spi.h Added support for MCP3008 and MCP3004 ADC for temperature read 2016-04-12 22:37:50 +02:00
temp.c Temp: faster cycles in continuous mode. 2016-06-25 15:54:53 +02:00
temp.h Temp: have residency updates on 1s clock. 2016-06-23 22:32:51 +02:00
timer-arm.c Step timer: reset timer after pauses instead of doing a guess. 2015-08-12 14:26:37 +02:00
timer-avr.c Step timer: reset timer after pauses instead of doing a guess. 2015-08-12 14:26:37 +02:00
timer.c ARM: split timer.c into platform specific files. 2015-08-12 14:26:36 +02:00
timer.h Step timer: reset timer after pauses instead of doing a guess. 2015-08-12 14:26:37 +02:00
usb_serial.c Drop redundant "simulator.h" includes. 2016-06-11 15:12:40 +02:00
usb_serial.h usb_serial.h: refine the note. 2016-04-27 23:53:42 +02:00
watchdog.c watchdog.c: fix compilation with module enabled. 2016-04-14 22:51:22 +02:00
watchdog.h ARM: get watchdog.c in. 2015-08-13 17:12:13 +02:00

README

##############################################################################
#                                                                            #
# Teacup - lean and efficient firmware for RepRap printers                   #
#                                                                            #
# by Triffid Hunter, Traumflug, jakepoz, many others.                        #
#                                                                            #
##############################################################################

For installation instructions, see
http://reprap.org/wiki/Teacup_Firmware#Simple_Installation and/or
http://reprap.org/wiki/Teacup_Firmware#Developer_Installation

For documentation, see
http://reprap.org/wiki/Teacup_Firmware


##############################################################################
#                                                                            #
# This firmware is Copyright (c) ...                                         #
#   2009 - 2010 Michael Moon aka Triffid_Hunter                              #
#   2010 - 2013 Markus "Traumflug" Hitter <mah@jump-ing.de>                  #
#                                                                            #
# This program is free software; you can redistribute it and/or modify       #
# it under the terms of the GNU General Public License as published by       #
# the Free Software Foundation; either version 2 of the License, or          #
# (at your option) any later version.                                        #
#                                                                            #
# This program is distributed in the hope that it will be useful,            #
# but WITHOUT ANY WARRANTY; without even the implied warranty of             #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
# GNU General Public License for more details.                               #
#                                                                            #
# You should have received a copy of the GNU General Public License          #
# along with this program; if not, write to the Free Software                #
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA #
#                                                                            #
##############################################################################