Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ void callNumber(String number)
String contact = mp.checkContact(number);
mp.inCall = 1;
mp.dataRefreshFlag = 0;
bool muted = false;
const byte *current_call_icon = call_icon;
uint16_t current_call_icon_color = TFT_GREEN;
char c;
String localBuffer = "";
String buffer = "";
Expand Down Expand Up @@ -516,6 +519,24 @@ void callNumber(String number)
callState = 1;
}
}
if (mp.buttons.pressed(14)) // mute, 14 is power button
{
if (mp.sim_module_version == 1 || mp.sim_module_version == 0)
{
muted = !muted;
Serial1.print(F("AT+CMUT="));
if (muted) {
current_call_icon = call_icon_muted;
current_call_icon_color = TFT_RED;
Serial1.println(1);
} else {
current_call_icon = call_icon;
current_call_icon_color = TFT_GREEN;
Serial1.println(0);
}
mp.waitForOK();
}
}
if (mp.buttons.pressed(BTN_FUN_RIGHT)) // hanging up
{

Expand Down Expand Up @@ -662,7 +683,7 @@ void callNumber(String number)
}
mp.display.setCursor(9, 9);
mp.display.printCenter(temp);
mp.display.drawBitmap(29*scale, 24*scale, call_icon, TFT_GREEN, scale);
mp.display.drawBitmap(29*scale, 24*scale, current_call_icon, current_call_icon_color, scale);
mp.display.setCursor(11, 28);
if(contact == "")
mp.display.printCenter(number);
Expand Down
25 changes: 25 additions & 0 deletions src/sprites.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,31 @@ const byte call_icon[] PROGMEM = { 24,22,
B00000000,B00000111,B11100000,
};

const byte call_icon_muted[] PROGMEM = { 24,22,
B00011100,B00000000,B00000111,
B00111110,B00000000,B00001110,
B01111111,B00000000,B00011100,
B11111111,B10000000,B00111000,
B11111111,B10000000,B01110000,
B11111111,B00000000,B11100000,
B11111110,B00000001,B11000000,
B11111110,B00000011,B10000000,
B11111110,B00000111,B00000000,
B01111111,B00001110,B00000000,
B01111111,B10011100,B00000000,
B00111111,B11111000,B00000000,
B00011111,B11110000,B00000000,
B00001111,B11110000,B01100000,
B00000111,B11111000,B11110000,
B00000011,B11111111,B11111000,
B00000111,B11111111,B11111100,
B00001110,B11111111,B11111100,
B00011100,B01111111,B11111100,
B00111000,B00111111,B11111000,
B01110000,B00011111,B11110000,
B11100000,B00000111,B11100000,
};

//Lock screen notification icons
const byte batteryChargingIcon[] PROGMEM = {
8,7,
Expand Down