Simu threads now correctly stopped

This commit is contained in:
Bertrand Songis
2016-03-11 18:16:53 +01:00
parent 946c17770a
commit 2e57549982
4 changed files with 38 additions and 10 deletions
+9 -7
View File
@@ -79,11 +79,6 @@ Adc Adc0;
uint8_t * eeprom_buffer_data;
volatile int32_t eeprom_buffer_size;
bool eeprom_read_operation;
#define EESIZE_SIMU (128*4096) // TODO why here?
#endif
#if !defined(EESIZE_SIMU)
#define EESIZE_SIMU EESIZE
#endif
#if defined(SDCARD) && !defined(SKIP_FATFS_DECLARATION)
@@ -336,7 +331,10 @@ void *eeprom_write_function(void *)
void StartSimu(bool tests)
{
main_thread_running = (tests ? 1 : 2);
s_current_protocol[0] = 255;
menuLevel = 0;
main_thread_running = (tests ? 1 : 2); // TODO rename to simu_run_mode with #define
#if defined(SDCARD)
if (strlen(simuSdDirectory) == 0) {
@@ -385,7 +383,11 @@ void StartSimu(bool tests)
void StopSimu()
{
main_thread_running = 0;
#if !defined(CPUARM)
#if defined(CPUARM)
pthread_join(mixerTaskId, NULL);
pthread_join(menusTaskId, NULL);
#else
pthread_join(main_thread_pid, NULL);
#endif
}
+8
View File
@@ -336,6 +336,7 @@ extern volatile unsigned char pina, pinb, pinc, pind, pine, pinf, ping, pinh, pi
extern uint8_t portb, portc, porth, dummyport;
extern uint16_t dummyport16;
extern uint8_t main_thread_running;
extern char * main_thread_error;
#define getADC()
#define getADC_bandgap()
@@ -362,6 +363,13 @@ void StopEepromThread();
#define StopAudioThread()
#endif
#if !defined(EEPROM_RLC)
#define EESIZE_SIMU (128*4096)
#else
#define EESIZE_SIMU EESIZE
#endif
extern uint8_t eeprom[EESIZE_SIMU];
extern const char * eepromFile;
void eepromReadBlock (uint8_t * pointer_ram, uint32_t address, uint32_t size);