Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Printrboard with LCD #2860

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,11 @@ void servo_init() {
* • status LEDs
*/
void setup() {
#ifdef DISABLE_JTAG
// Disable JTAG on AT90USB chips to free up pins for IO
MCUCR = 0x80;
MCUCR = 0x80;
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Compiler directives should be indented too in this codebase. And things inside of #if blocks also indented. In other words, every block indents, whether compiler or language.

setup_killpin();
setup_filrunoutpin();
setup_powerhold();
Expand Down
17 changes: 16 additions & 1 deletion Marlin/pins_PRINTRBOARD.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

#define LARGE_FLASH true

//Disable JTAG pins so they can be used for the Extrudrboard
#define DISABLE_JTAG true

#define X_STEP_PIN 0
#define X_DIR_PIN 1
#define X_ENABLE_PIN 39
Expand Down Expand Up @@ -64,7 +67,7 @@
////LCD Pin Setup////

#define SDPOWER -1
#define SDSS 8
#define SDSS 26
#define LED_PIN -1
#define PS_ON_PIN -1
#define KILL_PIN -1
Expand All @@ -89,6 +92,18 @@
#endif // LCD_I2C_PANELOLU2
//not connected to a pin
#define SD_DETECT_PIN -1

#define LCD_PINS_RS 9
#define LCD_PINS_ENABLE 8
#define LCD_PINS_D4 7
#define LCD_PINS_D5 6
#define LCD_PINS_D6 5
#define LCD_PINS_D7 4

#define BTN_EN1 16
#define BTN_EN2 17
#define BTN_ENC 18//the click

#endif // ULTRA_LCD && NEWPANEL

#if ENABLED(VIKI2) || ENABLED(miniVIKI)
Expand Down
3 changes: 2 additions & 1 deletion Marlin/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +896,12 @@ void tp_init() {
SET_OUTPUT(HEATER_BED_PIN);
#endif
#if HAS_FAN
SET_OUTPUT(FAN_PIN);
#if ENABLED(FAST_PWM_FAN)
SET_OUTPUT(FAN_PIN);
setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif
#if ENABLED(FAN_SOFT_PWM)
SET_OUTPUT(FAN_PIN);
soft_pwm_fan = fanSpeedSoftPwm / 2;
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ void lcd_init() {
#endif//!NEWPANEL

#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
pinMode(SD_DETECT_PIN, INPUT);
SET_INPUT(SD_DETECT_PIN);
WRITE(SD_DETECT_PIN, HIGH);
lcd_sd_status = 2; // UNKNOWN
#endif
Expand Down