Skip to content

Commit

Permalink
Mobo Logging and LCD print cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lofturj committed May 5, 2011
1 parent 373032e commit 988123e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 63 deletions.
15 changes: 0 additions & 15 deletions .framework
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@
<?fileVersion 1.0.0?>
<framework-data>
<options>
<<<<<<< HEAD
<option id="com.atmel.avr32.sf.uc3a3.driver.option.pm" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.service.option.debug" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.driver.option.intc" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.driver.option.tc" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.service.option.newlibaddon" value="speed"/>
<option id="com.atmel.avr32.sf.uc3a3.driver.option.flashc" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.driver.option.gpio" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.driver.option.usbb" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.component.option.joystick" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.service.option.freertos" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.driver.option.usart" value="true"/>
<option id="com.atmel.avr32.sf.uc3a3.service.option.usbb" value="USB HID Class (Human Interface Device)"/>
=======
>>>>>>> sdr-widget-2
</options>
<files>
</files>
Expand Down
2 changes: 1 addition & 1 deletion src/SOFTWARE_FRAMEWORK/BOARDS/SDRwdgtLite/SDR-Widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
// Audio specific features ----------------------------------------------------------------
#define TX_BARGRAPH_dB 0 // TX audio bargraph in dB or VU-meter style

// Menu Function specific features
// Menu Function specific features --------------------------------------------------------
#define PRG_AS_PUSH_BUTTON 1 // Activates the PRG button as a second optional Push Button
// used for the Menu Functions.

Expand Down
5 changes: 3 additions & 2 deletions src/freq_and_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ uint8_t new_freq_and_filters(uint32_t freq)

#if BPF_LPF_Module // Band Pass and Low Pass filter switcing
#if !FLTR_CGH_DURING_TX // Do not allow Filter changes when frequency is changed during TX
if (!TX_state) // Only change filters when not transmitting
if (!TX_flag) // Only change filters when not transmitting
#endif
#if CALC_BAND_MUL_ADD // Band dependent Frequency Subtract and Multiply
band = SetFilter(freq); // Select Band Pass Filter, according to the frequency selected
Expand Down Expand Up @@ -356,10 +356,11 @@ void freq_and_filter_control(void)
else freq_delta_from_enc = 0; // Zero any changes while Menu Control
}

// Check if a simple LCD update of Frequency display is required
// Check if a simple LCD update of Frequency and filters display is required
if((FRQ_lcdupdate == TRUE) && (!MENU_mode))
{
display_frequency();
SetFilter(cdata.Freq[0]); // Select Band Pass Filter, according to the frequency selected
FRQ_lcdupdate = FALSE;
}
}
Expand Down
77 changes: 32 additions & 45 deletions src/taskMoboCtrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ static uint8_t i2c_device_probe_and_log(uint8_t addr, char *addr_report)
{
// Print and Log the result
sprintf(report,"%s probed: %02x", addr_report, addr);
widget_display_string_scroll_and_log(report);
//widget_display_string_scroll_and_log(report);
widget_startup_log_line(report);
}
#endif

Expand Down Expand Up @@ -541,22 +542,22 @@ static void vtaskMoboCtrl( void * pcParameters )
// Initialize LCD
gpio_set_gpio_pin(LCD_BL_PIN); // Turn on LCD backlight
lcd_q_init();
lcd_q_clear();
lcd_bargraph_init();
#endif

//Todo! may want a better name for function, function has changed
features_display_all();

#if LOGGING
widget_startup_log_line(FIRMWARE_VERSION); // Log Firmware version
#else
#if ! LOGGING
#if LCD_DISPLAY // Multi-line LCD display
xSemaphoreTake( mutexQueLCD, portMAX_DELAY );
lcd_q_clear();
lcd_q_goto(3,10);
lcd_q_print(FIRMWARE_VERSION);
xSemaphoreGive( mutexQueLCD );
#endif
#endif
#endif

// Create I2C comms semaphore
mutexI2C = xSemaphoreCreateMutex();
Expand All @@ -568,88 +569,74 @@ static void vtaskMoboCtrl( void * pcParameters )
i2c_device_scan();
#endif

#if LOGGING
widget_startup_log_line(FIRMWARE_VERSION);
#else

#if ! LOGGING
#if LCD_DISPLAY // Multi-line LCD display
// Clear LCD and Print Firmware version again
xSemaphoreTake( mutexQueLCD, portMAX_DELAY );
lcd_q_clear();
lcd_q_goto(3,10);
lcd_q_print(FIRMWARE_VERSION);
xSemaphoreGive( mutexQueLCD );
#endif
#endif
#endif

#if Si570
#if Si570
// Print capabilities on LCD
#if ! LOGGING
#if ! LOGGING
xSemaphoreTake( mutexQueLCD, portMAX_DELAY );
lcd_q_goto(0,0);
#endif
#endif
// A Full house
if (i2c.si570 && i2c.tmp100 && i2c.ad5301 && i2c.ad7991 && i2c.pcfmobo && i2c.pcflpf1)
{
#if LOGGING
#if LOGGING
widget_startup_log_line("RX&TX&LPF Init OK");
#else
#else
lcd_q_print("RX&TX&LPF Init OK");
#endif
#endif
}
else if (i2c.si570 && i2c.tmp100 && i2c.ad5301 && i2c.ad7991 && i2c.pcfmobo)
{
#if LOGGING
#if LOGGING
widget_startup_log_line("RX & TX Init OK");
#else
#else
lcd_q_print("RX & TX Init OK");
#endif
#endif
}
else if (i2c.si570 && i2c.pcfmobo)
{
#if LOGGING
#if LOGGING
widget_startup_log_line("RX Init OK");
#else
#else
lcd_q_print("RX Init OK");
#endif
#endif
}
// Si570 present
else if (i2c.si570)
{
#if LOGGING
#if LOGGING
widget_startup_log_line("Si570 Init OK");
#else
#else
lcd_q_print("Si570 Init OK");
#endif
#endif
}
// I2C device problem
else
{
#if LOGGING
#if LOGGING
widget_startup_log_line("I2Cbus NOK");
#else
#else
lcd_q_print("I2Cbus NOK");
#endif
#endif//Si570
}
#if ! LOGGING
#if ! LOGGING
// Keep init info on LCD for 2 seconds
vTaskDelay( 20000 );
lcd_q_clear();
xSemaphoreGive( mutexQueLCD );
#endif
#endif
#endif
// Indicate Receive as an initial state
#if ! LOGGING
xSemaphoreTake( mutexQueLCD, portMAX_DELAY );
lcd_q_goto(0,0);
#endif
#if LOGGING
widget_startup_log_line("RX");
#else
lcd_q_print("RX");
#endif
#if ! LOGGING
xSemaphoreGive( mutexQueLCD );
#endif
#endif // Multi-line LCD display

// Fetch last frequency stored
cdata.Freq[0] = cdata.Freq[cdata.SwitchFreq];
Expand Down Expand Up @@ -880,7 +867,7 @@ static void vtaskMoboCtrl( void * pcParameters )
{
xSemaphoreTake( mutexQueLCD, portMAX_DELAY );
lcd_q_goto(0,0);
lcd_q_print("TX");
lcd_q_print("TX ");
xSemaphoreGive( mutexQueLCD );
}
#endif
Expand Down Expand Up @@ -913,7 +900,7 @@ static void vtaskMoboCtrl( void * pcParameters )
xSemaphoreTake( mutexQueLCD, portMAX_DELAY );
//lcd_q_clear();
lcd_q_goto(0,0);
lcd_q_print("RX");
lcd_q_print("RX ");
xSemaphoreGive( mutexQueLCD );
#endif
#endif
Expand Down
5 changes: 5 additions & 0 deletions src/taskStartupLogDisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "widget.h"
#include "features.h"
#include "Mobo_config.h"

/*! \brief scroll through a line of startup and go to sleep
*
Expand All @@ -45,6 +46,8 @@ static void vtaskStartupLogDisplay( void * pcParameters )

widget_display_clear();

MENU_mode = TRUE; // Grab LCD from Mobo tasks

while( 1 ) {
char **buffer_lines;
int lines;
Expand All @@ -63,6 +66,8 @@ static void vtaskStartupLogDisplay( void * pcParameters )
} else if (current_line < lines + 2) {
;
} else {
TX_state = TRUE; // Force Mobo LCD housekeeping
MENU_mode = FALSE; // return LCD to Mobo tasks
break;
}

Expand Down

0 comments on commit 988123e

Please sign in to comment.