Welcome! Log In Create A New Profile



Posted by 3ntrlab 
March 13, 2013 02:39AM
Why the pin numers are hardwired inside UICONFIG.H ?
I mean:

#define UI_DISPLAY_RS_PIN _BV(4)
#define UI_DISPLAY_RW_PIN _BV(5)
#define UI_DISPLAY_D0_PIN _BV(0)
#define UI_DISPLAY_D1_PIN _BV(1)
#define UI_DISPLAY_D2_PIN _BV(2)
#define UI_DISPLAY_D3_PIN _BV(3)
#define UI_DISPLAY_D4_PIN _BV(0)
#define UI_DISPLAY_D5_PIN _BV(1)
#define UI_DISPLAY_D6_PIN _BV(2)
#define UI_DISPLAY_D7_PIN _BV(3)


//UI_KEYS_CLICKENCODER_LOW_REV(33,31); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.
UI_KEYS_BUTTON_LOW(4,UI_ACTION_OK); // push button, connects gnd to pin
UI_KEYS_BUTTON_LOW(5,UI_ACTION_NEXT); // push button, connects gnd to pin
UI_KEYS_BUTTON_LOW(6,UI_ACTION_PREVIOUS); // push button, connects gnd to pin
UI_KEYS_BUTTON_LOW(11,UI_ACTION_BACK); // push button, connects gnd to pin
UI_KEYS_BUTTON_LOW(42,UI_ACTION_SD_PRINT ); // push button, connects gnd to pin
// UI_KEYS_CLICKENCODER_LOW_REV(47,45); // click encoder on pins 47 and 45. Phase is connected with gnd for signals.
// UI_KEYS_BUTTON_LOW(43,UI_ACTION_OK); // push button, connects gnd to pin

Couldn't be the #define and direct numbers moved into PINS.H ?
That way, you shouldn't browse more than a couple of files (config.h and pins.h) to quickly get up and running.

Best Regards
Davide Ardizzoia

no toys here...sorry
Re: uiconfig.h
March 13, 2013 04:27AM
The problem is flexibility. The pins.h is a file noone should need to touch if using the default board layout. Speaking of defaults, what would be the default pins combination for a RAMPS 1.4? How can I say all users need to use exactly these 8 pins for the display? Only the combination of a Display solution and a board gives a special pin combinations. For some widely used combination you can select this in the configuration.h with the FEATURE_CONTROLLER variable, e.g. the widely used Reprapdiscount Smartcontroller only needs a 2 and pins/settings for Display/keys/sd card are set correctly for RAMPS and Rumba board.

Speaking og keys this is an other flexible part. You can use a key matrix, switches or encoder or any combination putting any function on any key. How to hard code that?

So I think you see the pins differ from case to case. That leaves the place where to change them if needed. As said pins.h is no config file and has more then 10 boards for different places. So the best way is to put all the ui stuff in a separate config file, so the many users not having display/keys don't need to look at all these config options.

Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Sorry, only registered users may post in this forum.

Click here to login