diff --git a/libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.cpp b/libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.cpp index 86c68118fc9..19fca9832a7 100644 --- a/libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.cpp +++ b/libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.cpp @@ -5,16 +5,17 @@ // // Author : Stefan Schauer // Date : Mar 05, 2015 -// Version: 1.03 +// Version: 1.04 // File : LCD_SharpBoosterPack_SPI_main.c // // Version: 1.01 : added support for CC3200 // Version: 1.02 : added print class // Version: 1.03 : added support for Sharp 128 +// version: 1.04 : horrible patch for CC13x0 ENERGIA_ARCH_CC13XX // // Based on the LCD5110 Library // Created by Rei VILO on 28/05/12 -// Copyright (c) 2012 http://embeddedcomputing.weebly.com +// Copyright (c) 2012 https://embeddedcomputing.weebly.com // Licence CC = BY SA NC // // Edited 2015-07-11 by ReiVilo @@ -26,6 +27,9 @@ // Added flushReversed() for reversed display and preserved buffer // Simplified Clear function // +// Edited 2019-03-19 by StefaSch +// Added support for smaller memory with put LCD data to FRAM +// #include #include "LCD_SharpBoosterPack_SPI.h" @@ -38,13 +42,16 @@ uint8_t _pinVCC; uint8_t _pinChipSelect; uint8_t _pinSerialClock; bool _autoVCOM; +uint8_t lcd_vertical_max; +uint8_t lcd_horizontal_max; + // Booster Pack Pins -// 7 - P2.2 for SPI_CLK mode -// 15 - P1.6 for SPI_SIMO mode -// 6 - P2.4 output pin for SPI_CS -// 2 - P4.2 as output to supply the LCD -// 5 - P4.3 as output for DISP +// 7 - SPI_CLK mode +// 15 - SPI_SIMO mode +// 6 - output pin for SPI_CS +// 2 - output to supply the LCD +// 5 - output for DISP // Set display's VCC and DISP pins to high @@ -83,36 +90,40 @@ uint16_t LCD_SharpBoosterPack_SPI::_index(uint8_t x, uint8_t y) LCD_SharpBoosterPack_SPI::LCD_SharpBoosterPack_SPI(uint8_t model) { - _pinChipSelect = P_CS; - _pinDISP = P_DISP; - _pinVCC = P_VCC; - _autoVCOM = true; - - lcd_vertical_max = model; - lcd_horizontal_max = model; + LCD_SharpBoosterPack_SPI(P_CS, P_DISP, P_VCC, true, model); +} - static uint8_t * _frameBuffer; - _frameBuffer = new uint8_t[_index(lcd_vertical_max, lcd_horizontal_max)]; - DisplayBuffer = (uint8_t *) _frameBuffer; +LCD_SharpBoosterPack_SPI::LCD_SharpBoosterPack_SPI(uint8_t pinChipSelect, uint8_t pinDISP, uint8_t pinVCC, uint8_t model) +{ + LCD_SharpBoosterPack_SPI(pinChipSelect, pinDISP, pinVCC, true, model); } -LCD_SharpBoosterPack_SPI::LCD_SharpBoosterPack_SPI(uint8_t pinChipSelect, uint8_t pinDISP, uint8_t pinVCC, bool autoVCOM, uint8_t model) +#ifdef PLACE_IN_FRAM + uint8_t _frameBuffer[128][128/8] PLACE_IN_FRAM; +#else + uint8_t * _frameBuffer = 0; +#endif + +LCD_SharpBoosterPack_SPI::LCD_SharpBoosterPack_SPI(uint8_t pinChipSelect, uint8_t pinDISP, uint8_t pinVCC, bool autoVCOM, uint8_t model) { + _pinChipSelect = pinChipSelect; _pinDISP = pinDISP; _pinVCC = pinVCC; _autoVCOM = autoVCOM; - digitalWrite(RED_LED, HIGH); lcd_vertical_max = model; lcd_horizontal_max = model; -} -LCD_SharpBoosterPack_SPI::LCD_SharpBoosterPack_SPI(uint8_t pinChipSelect, uint8_t pinDISP, uint8_t pinVCC, uint8_t model) -{ - LCD_SharpBoosterPack_SPI(pinChipSelect, pinDISP, pinVCC, true, model); +#ifndef PLACE_IN_FRAM + if (_frameBuffer == 0){ + _frameBuffer = new uint8_t[_index(lcd_vertical_max, lcd_horizontal_max)]; + } +#endif + DisplayBuffer = (uint8_t *) _frameBuffer; } + void LCD_SharpBoosterPack_SPI::setOrientation(uint8_t orientation) { _orientation = orientation % 4; @@ -528,9 +539,13 @@ static void SendToggleVCOMCommand(void) // Set P2.4 High for CS digitalWrite(_pinChipSelect, HIGH); +#if defined(ENERGIA_ARCH_CC13XX) // Horrible patch for CC13x0 + shiftOut(15, 7, MSBFIRST, (char)command); + shiftOut(15, 7, MSBFIRST, (char)SHARP_LCD_TRAILER_BYTE); +#else SPI.transfer((char)command); SPI.transfer((char)SHARP_LCD_TRAILER_BYTE); - +#endif // Wait for last byte to be sent, then drop SCS delayMicroseconds(10); // Set P2.4 High for CS diff --git a/libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.h b/libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.h index 6058406162a..88924228a2e 100644 --- a/libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.h +++ b/libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.h @@ -5,12 +5,12 @@ // // Author : Stefan Schauer // Date : Mar 05, 2015 -// Version: 1.02 +// Version: 1.04 // File : LCD_SharpBoosterPack_SPI_main.h // // Based on the LCD5110 Library // Created by Rei VILO on 28 May 2012 -// Copyright (c) 2012 http://embeddedcomputing.weebly.com +// Copyright (c) 2012 https://embeddedcomputing.weebly.com // Licence CC = BY SA NC // // Edited 11 Jul 2015 by ReiVilo @@ -21,6 +21,12 @@ // Added support for Sharp 128 with minimal change // Added flushReversed() for reversed display and preserved buffer // +// Edited 2019-03-19 by StefaSch +// Added support for smaller memory with put LCD data to FRAM +// +// Edited 22 Apr 2020 by ReiVilo +// Horrible patch for CC13x0 ENERGIA_ARCH_CC13XX +// #ifndef LCD_SharpBoosterPack_SPI_h #define LCD_SharpBoosterPack_SPI_h @@ -136,7 +142,7 @@ class LCD_SharpBoosterPack_SPI : public Print /// /// @brief Get size àf the screen - /// @return 96 for 96x96 or &28 for 128x128 + /// @return 96 for 96x96 or 128 for 128x128 /// uint8_t getSize(); diff --git a/libraries/OneMsTaskTimer/OneMsTaskTimer.cpp b/libraries/OneMsTaskTimer/OneMsTaskTimer.cpp index 097ea842bc2..ed018269d3e 100644 --- a/libraries/OneMsTaskTimer/OneMsTaskTimer.cpp +++ b/libraries/OneMsTaskTimer/OneMsTaskTimer.cpp @@ -129,7 +129,7 @@ void OneMsTaskTimer_int(void) { OneMsTaskTimer::_ticHandler(); } - + #endif //if defined(__MSP430__) @@ -271,7 +271,7 @@ void OneMsTaskTimer_int(void) #define DEFAULT_TIMER 1 uint32_t timer_index_ = DEFAULT_TIMER; static volatile uint32_t g_ulBase; -Clock_Handle myClock = NULL; +Clock_Handle myOneMsTaskTimerClock = NULL; void OneMsTaskTimer_int(UArg arg); void OneMsTaskTimer::start(uint32_t timer_index) { @@ -279,19 +279,19 @@ void OneMsTaskTimer::start(uint32_t timer_index) { Error_Block eb; Error_init(&eb); - if (myClock == NULL){ + if (myOneMsTaskTimerClock == NULL){ Clock_Params_init(&clockParams); clockParams.period = (uint32_t)1000 / (uint64_t)Clock_tickPeriod; clockParams.startFlag = FALSE; clockParams.arg = (UArg)0x5555; - myClock = Clock_create(OneMsTaskTimer_int, clockParams.period, &clockParams, &eb); + myOneMsTaskTimerClock = Clock_create(OneMsTaskTimer_int, clockParams.period, &clockParams, &eb); } - Clock_start(myClock); + Clock_start(myOneMsTaskTimerClock); } void OneMsTaskTimer::stop() { - Clock_stop(myClock); + Clock_stop(myOneMsTaskTimerClock); } void OneMsTaskTimer_int(UArg arg) { diff --git a/libraries/OneMsTaskTimer/OneMsTaskTimer.h b/libraries/OneMsTaskTimer/OneMsTaskTimer.h index e2658f1efd7..793852ba065 100644 --- a/libraries/OneMsTaskTimer/OneMsTaskTimer.h +++ b/libraries/OneMsTaskTimer/OneMsTaskTimer.h @@ -10,6 +10,8 @@ added suppport for CC3200 by Stefan Sch + 23 Apr 2020 - Renamed trivial myClock name to myOneMsTaskTimerClock to avoid prossible conflicts, by Rei Vilo + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -101,4 +103,4 @@ namespace OneMsTaskTimer { void _ticHandler(); } -#endif +#endif