[Stylecheck] F0, F1, F4
There are remaining C99 comments.
This commit is contained in:
@@ -70,15 +70,15 @@ static char color[maxIter+1] = " .:++xxXXX%%%%%%################";
|
||||
/* Main mandelbrot calculation */
|
||||
static int iterate(float px, float py)
|
||||
{
|
||||
int it=0;
|
||||
float x=0,y=0;
|
||||
while(it<maxIter)
|
||||
{
|
||||
int it = 0;
|
||||
float x = 0, y = 0;
|
||||
while (it < maxIter) {
|
||||
float nx = x*x;
|
||||
float ny = y*y;
|
||||
if( (nx + ny) > 4 )
|
||||
if ((nx + ny) > 4) {
|
||||
return it;
|
||||
// Zn+1 = Zn^2 + P
|
||||
}
|
||||
/* Zn+1 = Zn^2 + P */
|
||||
y = 2*x*y + py;
|
||||
x = nx - ny + px;
|
||||
it++;
|
||||
@@ -88,12 +88,10 @@ static int iterate(float px, float py)
|
||||
|
||||
static void mandel(float cX, float cY, float scale)
|
||||
{
|
||||
int x,y;
|
||||
for(x=-60;x<60;x++)
|
||||
{
|
||||
for(y=-50;y<50;y++)
|
||||
{
|
||||
int i = iterate(cX+x*scale, cY+y*scale);
|
||||
int x, y;
|
||||
for (x = -60; x < 60; x++) {
|
||||
for (y = -50; y < 50; y++) {
|
||||
int i = iterate(cX + x*scale, cY + y*scale);
|
||||
usart_send_blocking(USART2, color[i]);
|
||||
}
|
||||
usart_send_blocking(USART2, '\r');
|
||||
@@ -111,8 +109,8 @@ int main(void)
|
||||
|
||||
while (1) {
|
||||
/* Blink the LED (PD12) on the board with each fractal drawn. */
|
||||
gpio_toggle(GPIOD, GPIO12); /* LED on/off */
|
||||
mandel(centerX,centerY,scale); /* draw mandelbrot */
|
||||
gpio_toggle(GPIOD, GPIO12); /* LED on/off */
|
||||
mandel(centerX, centerY, scale); /* draw mandelbrot */
|
||||
|
||||
/* Change scale and center */
|
||||
centerX += 0.175f * scale;
|
||||
|
||||
Reference in New Issue
Block a user