Hallo Forum,
ich habe hier so ein kleines Problem und weiß nicht woran es hängt.
Ich habe folgende Sachen global vor Beginn meiner main() definiert:
1 | //Used mutex
|
2 | pthread_mutex_t SD_write_buffer_mutex=PTHREAD_MUTEX_INITIALIZER;
|
3 | pthread_mutex_t SD_write_Files_Download_mutex=PTHREAD_MUTEX_INITIALIZER;
|
4 | pthread_mutex_t SD_read_mutex=PTHREAD_MUTEX_INITIALIZER;
|
5 | pthread_mutex_t SPI_in_use_mutex=PTHREAD_MUTEX_INITIALIZER;
|
6 | pthread_mutex_t Firmware_Flash_mutex=PTHREAD_MUTEX_INITIALIZER;
|
7 | pthread_rwlock_t config_used;
|
8 |
|
9 | int main(void){.......
|
in einer Funktion möchte ich dann folgendes verwenden:
1 | while(pthread_rwlock_wrlock(&config_used));
|
2 | while(pthread_mutex_lock(&SD_write_buffer_mutex));
|
Jetzt sagt mir aber mein Compiler folgendes (Linaro GCC 4.8) mit
-std=gnu99:
Description Resource Path Location Type
'config_used' undeclared (first use in this function) SPI_RW.c
/Miep/source line 179 C/C++ Problem
Description Resource Path Location Type
'SD_write_buffer_mutex' undeclared (first use in this function)
SPI_RW.c /Miep/source line 187 C/C++ Problem