2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file tunerstudio.h
|
|
|
|
*
|
|
|
|
* @date Aug 26, 2013
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2020-04-01 16:00:56 -07:00
|
|
|
#pragma once
|
2018-09-16 19:25:17 -07:00
|
|
|
#include "global.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "tunerstudio_io.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int queryCommandCounter;
|
|
|
|
int outputChannelsCommandCounter;
|
|
|
|
int readPageCommandsCounter;
|
|
|
|
int burnCommandCounter;
|
|
|
|
int pageCommandCounter;
|
|
|
|
int writeValueCommandCounter;
|
|
|
|
int crc32CheckCommandCounter;
|
|
|
|
int writeChunkCommandCounter;
|
|
|
|
int errorCounter;
|
2017-03-26 14:19:08 -07:00
|
|
|
int totalCounter;
|
|
|
|
int textCommandCounter;
|
2017-05-09 09:07:52 -07:00
|
|
|
int testCommandCounter;
|
2015-07-10 06:01:56 -07:00
|
|
|
} tunerstudio_counters_s;
|
|
|
|
|
2019-10-08 18:02:51 -07:00
|
|
|
extern tunerstudio_counters_s tsState;
|
|
|
|
|
2021-11-10 04:29:40 -08:00
|
|
|
void tunerStudioDebug(TsChannelBase* tsChannel, const char *msg);
|
|
|
|
void tunerStudioError(TsChannelBase* tsChannel, const char *msg);
|
|
|
|
|
2021-11-29 13:44:45 -08:00
|
|
|
uint8_t* getWorkingPageAddr();
|
2021-11-10 04:29:40 -08:00
|
|
|
|
|
|
|
#if EFI_TUNER_STUDIO
|
|
|
|
#include "thread_controller.h"
|
|
|
|
#include "thread_priority.h"
|
|
|
|
|
2021-12-15 17:11:08 -08:00
|
|
|
void updateTunerStudioState();
|
2022-04-13 21:35:33 -07:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
void requestBurn(void);
|
|
|
|
|
|
|
|
void startTunerStudioConnectivity(void);
|
|
|
|
|
2022-07-06 21:35:11 -07:00
|
|
|
typedef struct {
|
2020-12-08 00:05:43 -08:00
|
|
|
short int offset;
|
|
|
|
short int count;
|
|
|
|
} TunerStudioWriteChunkRequest;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-03-15 07:31:19 -07:00
|
|
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
|
|
|
#define CONNECTIVITY_THREAD_STACK (2 * UTILITY_THREAD_STACK_SIZE)
|
|
|
|
|
2021-03-18 11:07:22 -07:00
|
|
|
class TunerstudioThread : public ThreadController<CONNECTIVITY_THREAD_STACK> {
|
|
|
|
public:
|
|
|
|
TunerstudioThread(const char* name)
|
|
|
|
: ThreadController(name, PRIO_CONSOLE)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Initialize and return the channel to use for this thread.
|
|
|
|
virtual TsChannelBase* setupChannel() = 0;
|
|
|
|
|
|
|
|
void ThreadTask() override;
|
2022-03-15 07:31:19 -07:00
|
|
|
|
2021-03-18 11:07:22 -07:00
|
|
|
};
|
2022-03-15 07:31:19 -07:00
|
|
|
#endif
|
2021-03-18 11:07:22 -07:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
#endif /* EFI_TUNER_STUDIO */
|